Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added this to my .vimrc:

nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>

This works in normal and visual mode, but I can still use arrows in insert mode.

I'm using Janus to set up my vim.

I'm a two-week convert, so my vim foo is limited. Is this a MacVim-related issue? Is Janus' configuration somehow getting in the way?

share|improve this question
up vote 0 down vote accepted

The first thing to do is to try to determine if your mappings are defined as you expect:

:verbose imap <up>
:verbose imap <down>

...etc.

This will show you what the current insert mode mapping is for your keys, and—if they are somehow being overridden—where they were defined.

share|improve this answer
    
This is a sample output I get. Not sure what to make of it. Is the autoclose plugin the culprit? i <Down> *@<C-R>=<SNR>23_FlushBuffer()<CR><Down> Last set from ~/.vim/plugin/autoclose.vim i <Down> * <Nop> Last set from ~/.vimrc.local Press ENTER or type command to continue – hakanensari Nov 16 '10 at 3:15
    
Yes, this shows that the autoclose plugin is resetting the mappings. You can probably safely edit that file and comment out the lines that define the arrow key mappings, using a leading double quote character. – Heptite Nov 16 '10 at 18:53
    
Thanks! Note to Janus users: Move remapping to .gvimrc.local. – hakanensari Nov 18 '10 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .