How can I move around in the Vim command line?

后端 未结 7 1539
逝去的感伤
逝去的感伤 2020-12-12 12:36

If you\'re typing a command in Vim (I mean you\'ve started with : and you\'re working in the bar at the bottom of the screen) is there a way to move the cursor

相关标签:
7条回答
  • 2020-12-12 13:13

    You can actually add your own movement keys. For example, I use the following in my .vimrc to make moving around the command mode finger-friendly in an hjkl way (abusing the ctrl key):

     " moving aroung in command mode
     cnoremap <c-h> <left>
     cnoremap <c-j> <down>
     cnoremap <c-k> <up>
     cnoremap <c-l> <right>
     cnoremap ^     <home>
     cnoremap $     <end>
    

    where ^ and $ are really < ctrl-^ > and < ctrl-$ > respectivelly, typed as < c-v >< c-^ > and < c-v >< c-$ > in the .vimrc (for some reason < c-^ > and < c-$ > won't work, at least in my setting, but the former do)

    0 讨论(0)
提交回复
热议问题