I am trying to disable the arrow keys in the vimrc (previously I was doing it by doing a no-op on the keyboard itself):

"Disable arrow keys
inoremap <Left> <Nop>

However, it seems to be doing nothing, as it seems like the actual keyboard code sent for an arrow key (using insert, ctrl-v) is:


So, is there a way to disable the arrow keys from within vim? Or does this need to be done outside it?

  • Does this question answer yours?
    – Biggybi
    Jun 10 '20 at 5:36
  • @Biggybi -- no. I'm already doing noremap <Up> <Nop>, and wondering why that's not working, etc.
    – David542
    Jun 10 '20 at 5:39
  • Not sure what's happening, but you could always remap them to, say, <c-o>echo "Nice try!"<cr>
    – Biggybi
    Jun 10 '20 at 5:52
  • Can't reproduce. Your inoremap <Left> <Nop> works for me in terminal and gui in Vim 8.2 (linux).
    – Ralf
    Jun 10 '20 at 5:53
  • 1
    Your mapping should work correctly I also reproduce it in a Vim 8.0 and neovim 0.4.3. I think you might be interested in how to debug a mapping and maybe also how to debug my vimrc
    – statox
    Jun 10 '20 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.