Re: [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)
- From: Chris Jones <cjns3274@xxxxxxxxxxxxx>
- Date: Sat, 15 Apr 2006 00:13:01 -0400
Michael Kopp wrote:
[..]
Is there any way I could move the cursor using Ctrl+key/Alt+key combos while staying in insert mode.. or is the best strategy to just get used to escaping back to "normal" mode and use the more powerful vim cursor movement commands..
I use the following mappings:
imap <C-h> <C-o>h
imap <C-j> <C-o>j
imap <C-k> <C-o>k
imap <C-l> <C-o>
imap <C-d> <end>
sorry I didn't reply sooner - there are just too many goodies in Vim to stay focused & I got sidetracked yet again.
but, this is one "scheme" I have considered - possibly using Alt instead of Ctrl if feasible - because, on my keyboard at least, the Alt keys are a lot easier to access than the Ctrl keys. The idea being that since I cannot use the <hjkl> keys - <hjkl> + modifier might be the next best thing..
Ergonomically, it still bothers me to have to switch to different keys when I switch editing modes. More so than adding the inconvenience of using a modifier in "normal" mode. After all I would imagine I spend more time in insert mode.
So how about using Alt + <hjkl> in all editing modes for consistency..? It actually works out-of-the-box in "normal mode" .. except that when I do this Vim complains by sounding the system bell..
.
Note that the first line overwrites the original function of <C-h> which is to delete the previous character. Also <C-h> and <C-l> do not work exactly as expected when you are at the end of a line (this is because, switching to normal mode at the end of a line will move the cursor back one character).
Michael.
- References:
- [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)
- From: Chris Jones
- Re: [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)
- From: Michael Kopp
- [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)
- Prev by Date: Re: [vim] Getting the name of the current file
- Next by Date: Re: inverse lines - vim
- Previous by thread: Re: [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)
- Next by thread: emacs q
- Index(es):
Relevant Pages
|