我的主目录中有一个 .vimrc 文件,我在其中放置了一些 vim 命令,但这些命令只能在 gVim 中使用,而不能在 Vim 中使用。问题是什么? Vim 还有其他配置文件吗?
顺便说一句,这是我的 .vimrc 文件:
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。我只能在 vim 中运行 Ctrl-s 命令,并且可以在 vim 中以 gVim 的形式运行其他命令。
最佳答案
http://pangea.stanford.edu/computing/unix/shell/loginstuck.php
终端中的Ctrl-S
是 XOFF
,因此终端可能会解释它而不是将其传递给 vim。
尝试设置不同的配色方案或其他可见的更改,以确保您的 .vimrc 已加载。
或者,运行“:nmap
”来查看当前的正常模式映射是什么,以确认您拥有它们。
更新:修复方法是显式取消定义停止序列
stty stop undef
或者按照@Sam Brinck的建议禁用XON/XOFF流量控制
stty -ixon
关于vim - Vim 是否有与 gVim 不同的运行时配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7275753/