Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worf-back and worf-forward default key mappings #31

Open
dmgm opened this issue Apr 22, 2017 · 3 comments
Open

worf-back and worf-forward default key mappings #31

dmgm opened this issue Apr 22, 2017 · 3 comments

Comments

@dmgm
Copy link

dmgm commented Apr 22, 2017

I find the default mapping of [ and ] in worf to worf-backward and worf-forward to be awkward, as this prevents me from manually typing in links with square brackets.

I can override the mappings with the following in my init file;

(define-key worf-mode-map "]" nil)
(define-key worf-mode-map (kbd "M-]") 'worf-forward)
(define-key worf-mode-map "[" nil)
(define-key worf-mode-map (kbd "M-[") 'worf-backward)

Am I missing something? Surely it isn't desirable to effectively prevent the use of the characters [ and [ in all org-mode files?

Would this be a better default?

@abo-abo
Copy link
Owner

abo-abo commented Apr 22, 2017

Am I missing something? Surely it isn't desirable to effectively prevent the use of the characters [ and [ in all org-mode files?

Links can be inserted with C-c C-l.

The [ and ] chars can be inserted with C-q [ and C-q ]. I never do that though, I use something like this:

(defun ora-brackets ()
  (interactive)
  (insert "[]")
  (backward-char))
(global-set-key "ρ" 'ora-brackets)

The motivation for using [ and ] is simple: I navigate 90% of the time, and insert only 10% of the time. Therefore I assign easier keys to navigation rather than insertion.

Of course, this is Emacs. You can choose your own keys.

@dmgm
Copy link
Author

dmgm commented Apr 22, 2017

Thank you. I did not know about (quoted-insert) that seems like a more generic way to occasionally insert [], and as you say I can insert links and also use the mac-link-grab package. I agree with you that navigation being the most common case.

Would you consider adding to the documentation under the miscellaneous section. Perhaps I'm not the only one to have something new to learn about emacs.

"Go backwards to closest special position. ] does the same in the opposite direction. If you need to insert a [ or ] in the body, this can be done by prefixing the key with C-q."

@abo-abo
Copy link
Owner

abo-abo commented Apr 23, 2017

Please add a PR with a doc update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants