Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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've been working with Vim on two different machines, one running Ubuntu 10.04 (gVim) and the other Snow Leopard (MacVim). I copied my .vimrc file and .vim folder to both, and noticed a few minor differences. 2 questions:

1 . I used Drew Neil's vimcast on indentation and added the following to my .vimrc:

nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv

Which maps Cmd+[ and Cmd+] to indent in/out. In Linux I replaced 'D' with 'C', so that it works with Ctrl+[ / ]. All of that works on both machines, only that on Linux, hitting the Escape key after indenting performs an un-indent action. Any thoughts?

2 . I added some script I found to my .vimrc that enables shifting rows (normal and visual mode) up/down by holding Ctrl and using the up/down keys. It works great on Linux, but doesn't work at all on Mac, and I can't understand why. See my .vimrc file here.

share|improve this question
    
can you formulate it as one or two questions? – Peter Mortensen Aug 18 '10 at 6:49
4  
On your Linux system, are you using Vim in GUI-mode or in tty-mode (i.e. through a terminal program like xterm, rxvt, Gnome Terminal, et cetera)? Your problem likely is due to the fact that Escape and Control-[ share the same character representation (ASCII 27) and are indistinguishable in a tty-based environment. The GUI version of Vim should be able to distinguish Escape from Control-[, but it may choose not to. – Chris Johnsen Aug 18 '10 at 7:06
    
I use the gui version on both linux and mac (gnome-vim and macvim). Perhaps I'll map it to another key (Ctrl+T / Ctrl+Shift+T). – sa125 Aug 18 '10 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.