tags:

views:

85

answers:

2

In vim how to map "save" to ctrl-s . (i am trying "map" command, but xterm freezes when i give ctrl-s. If i give ctrl-v,ctrl-s still i see only a ^, not ^S)

+5  A: 

Ctrl-S is a common command to terminals to stop updating, it was a way to slow the output so you could read it on terminals that didn't have a scrollback buffer. First find out if you can configure your xterm to pass Ctrl-S through to the application. Then these map commands will work:

noremap <silent> <C-S>          :update<CR>
vnoremap <silent> <C-S>         <C-C>:update<CR>
inoremap <silent> <C-S>         <C-O>:update<CR>

BTW: if Ctrl-S freezes your terminal, type Ctrl-Q to get it going again.

Ned Batchelder
A: 

If you are on a mac you could try MacVim.

Maletor