为什么 .vimrc 不被执行?
Why doesn't .vimrc get executed?
当我尝试使用 . .vimrc
时出现错误:
bash: runtime! command not found
bash: syntax: command not found
bash: filetype: command not found
bash: filetype: command not found
它只是无缘无故地停止工作,所有其他点文件似乎都工作正常。 .vimrc
包含这个:
runtime! archlinux.vim
set number
set noswapfile
set nobackup
syntax on
set autoindent
set smartindent
set smarttab
filetype plugin on
filetype indent on
set incsearch
set hlsearch
它在那里的评论中也给出了一个错误。
~/.vimrc
是 vim
的运行时配置文件,即该文件将在 vim
启动时读取,并且所有语句都是 vim
特定的。
当您尝试 source
bash
中的文件时,您会收到错误消息,因为 bash
不知道 vim
特定语句,例如 runtime
、syntax
等
.
(或source
)命令是一个bash
命令,它在当前 shell 个实例。
.vimrc
文件 不是 一个 bash
脚本,它是由 vim
而不是 [=12= 读取和处理的东西].
这与尝试使用 Pascal 编译器编译 C 代码没有什么不同。文件内容不适合您要对其执行的操作。 .vimrc
文件应该会在您下次 运行 一个 vim
实例时自动获取。
使用vim
或vi
代替source
命令激活.vimrc
。因为.vimrc
不像[=16]那样*.sh
=]等
当我尝试使用 . .vimrc
时出现错误:
bash: runtime! command not found
bash: syntax: command not found
bash: filetype: command not found
bash: filetype: command not found
它只是无缘无故地停止工作,所有其他点文件似乎都工作正常。 .vimrc
包含这个:
runtime! archlinux.vim
set number
set noswapfile
set nobackup
syntax on
set autoindent
set smartindent
set smarttab
filetype plugin on
filetype indent on
set incsearch
set hlsearch
它在那里的评论中也给出了一个错误。
~/.vimrc
是 vim
的运行时配置文件,即该文件将在 vim
启动时读取,并且所有语句都是 vim
特定的。
当您尝试 source
bash
中的文件时,您会收到错误消息,因为 bash
不知道 vim
特定语句,例如 runtime
、syntax
等
.
(或source
)命令是一个bash
命令,它在当前 shell 个实例。
.vimrc
文件 不是 一个 bash
脚本,它是由 vim
而不是 [=12= 读取和处理的东西].
这与尝试使用 Pascal 编译器编译 C 代码没有什么不同。文件内容不适合您要对其执行的操作。 .vimrc
文件应该会在您下次 运行 一个 vim
实例时自动获取。
使用vim
或vi
代替source
命令激活.vimrc
。因为.vimrc
不像[=16]那样*.sh
=]等