-2

After working with vim in environments other than Mac I find myself missing the ability to use the arrow keys while in insert mode to navigate around. I know what I have to change is in ~/.vimrc but I don't know the syntax for it:

inoremap  <Up>     <NOP>
inoremap  <Down>   <NOP>
inoremap  <Left>   <NOP>
inoremap  <Right>  <NOP>
noremap   <Up>     <NOP>
noremap   <Down>   <NOP>
noremap   <Left>   <NOP>
noremap   <Right>  <NOP>

I know the keys are ^[[A, ^[[B, ^[[C, and ^[[D for Up, Down, Left, and Right respectively. Would the syntax just be imap <Down> <^[[B>? I'm a little sketched to change it before I know for sure because I don't want vim to be screwed up.

  • If it's screwed, then just close it and reload vim after reverting the command. – wxz Oct 17 '22 at 19:18
  • where you got those mappings? In a clean install of vim, you should be able to use arrow key by default? – jdhao Oct 18 '22 at 02:40

1 Answers1

1

The arrow keys work out of the box so you don't have to change anything to the default setup.

If you are considering adding those lines or variations of them to your vimrc, then you can stop right now as the original form is utterly pointless and the way you are trying to change them is useless.

If you already have mindlessly copied them from somewhere or they are part of someone else's config you took for your own, then remove them as they are probably the reason why your arrow keys don't work.

romainl
  • 186,200
  • 21
  • 280
  • 313