vim - Vim 是否有与 gVim 不同的运行时配置文件?

标签 vim

我的主目录中有一个 .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-SXOFF,因此终端可能会解释它而不是将其传递给 vim。

尝试设置不同的配色方案或其他可见的更改,以确保您的 .vimrc 已加载。

或者,运行“:nmap”来查看当前的正常模式映射是什么,以确认您拥有它们。

更新:修复方法是显式取消定义停止序列

stty stop undef

或者按照@Sam Brinck的建议禁用XON/XOFF流量控制

stty -ixon

关于vim - Vim 是否有与 gVim 不同的运行时配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7275753/

相关文章:

vim - 在 Vim 中, "alternate file"是什么?

使用 Vundle 安装时出现 Git 错误

windows - Windows 上的管道文件在哪里?

vim - 退出 VIM 后保留撤消缓冲区?

linux - 如何使vim正确格式化源代码

Vim Clojure Cider Fireplace 连接需要指定端口

vim 在两个文件之间选择和复制文本

macos - 这是适用于 OS X Snow Leopard 的 Vim 版本吗?

debugging - 如何在 Vim 中找出某个快捷键触发了哪个命令

c++ - 查找包含特定文本的函数的正则表达式是什么?