Re: [Vim] - Cursor movement when in insert mode or cmdline mode (: or ex)



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.
.



Relevant Pages

  • Re: POGO GAME PROBLEM USING MS INTERNET EXPLORER
    ... disable them all if you want to enable popups. ... With popups disabled you must hold down the Alt and Ctrl keys together when ... the Ctrl and Alt keys at the same time" but NOTHING happens when I do that ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Newsreader: Best of the bunch?
    ... I'm talking about COMMON functions such as ... which gives me that, I'll switch to it. ... When I use another editor, I constantly hit wrong keys, ...
    (Debian-User)
  • Re: OT Reptitive Strain Injury
    ... So far the doctors have offered nothing ... are reprogrammable and they have a cluster of keys under each thumb. ... Switch and don't look back. ... layouts) but if you already have problems you don't want to be tensing ...
    (comp.lang.lisp)
  • Re: rebinding keys to functions
    ... The function keys for ... switch that switched off the internal speakers when you inserted ... a 3,5mm jack. ...
    (freebsd-questions)
  • Re: fast typing = problems
    ... If "fat fingers" means hitting two adjacent keys at once, ... 'regular' keys does trip up this keyboard somehow. ... Likewise, I hit the spacebar with my right thumb, smack in the middle of the ... The Ctrl or Alt keys do not stick, ...
    (microsoft.public.windows.vista.general)