Reputation: 8456
I have a .vimrc file in my home directory in which I have put some vim commands but those commands only work in gVim and not in Vim. What is the problem? Is there another config file for Vim?
By the way, here is my .vimrc file:
1 colorscheme desert
2 " To save, ctrl-s.
3 nmap <c-s> :w<CR>
4 imap <c-s> <Esc>:w<CR>a
5 " Set the boolean number option to true
6 set number
7 highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
8 " Set the shift width(for Python programmnig)"
9 set sw=4
10 "Convert all tabs to an equivalent spaces"
11 set expandtab
12 set softtabstop=4
13 retab
14 "Show cursor position in status bar"
15 set ruler
PS. I only cannot run the command Ctrl-s in the vim and I am able to run other commands in vim as gVim.
Upvotes: 2
Views: 686
Reputation: 3205
http://pangea.stanford.edu/computing/unix/shell/loginstuck.php
Ctrl-S
in terminal is XOFF
, so the terminal may be interpreting it and not passing it on to vim.
Try setting a different colorscheme or other visible change to make sure your .vimrc is loaded.
Alternatively, run ":nmap
" to see what your current normal mode mappings are to confirm you have them.
UPDATE: The fix is to undefine the stop sequence explicitly
stty stop undef
or to disable XON/XOFF flow control as suggested by @Sam Brinck
stty -ixon
Upvotes: 4