Linux使用VIM编辑器的方法

2019-10-09 15:25:31丽君

set undofile

错误信息响铃,只对错误信息起作用:

set errorbells

如果你愿意,还可以设置错误视觉提示:

set visualbell

惊喜

Vim 提供长格式和短格式命令,两种格式都可用于设置或取消选项配置。

autoindent 选项的长格式是:

set autoindent

autoindent 选项的短格式是:

set ai

要在不更改选项当前值的情况下查看其当前设置,可以在 Vim 的命令行上使用在末尾加上 ? 的命令:

set autoindent?

在大多数选项前加上 no 前缀可以取消或关闭选项:

set noautoindent

可以为单独的文件配置选项,而不必修改全局配置文件。需要的话,请打开文件并输入 :,然后键入 set命令。这样的话,配置仅对当前的文件编辑会话有效。

使用命令行获取帮助:

:help autoindent

注意:此处列出的命令仅对 Linux 上的 Vim 7.4 版本和 Windows 上的 Vim 8.0 版本进行了测试。

这些有用的命令肯定会增强您的 Vim 使用体验。你会推荐哪些其他有用的命令?

选项列表
复制该选项列表粘贴到 .vimrc 文件中:

" Indentation & Tabs
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
" Display & format
set number
set textwidth=80
set wrapmargin=2
set showmatch
" Search
set hlsearch
set incsearch
set ignorecase
set smartcase
" Browse & Scroll
set scrolloff=5
set laststatus=2
" Spell
set spell spelllang=en_us
" Miscellaneous
set nobackup
set noswapfile
set autochdir
set undofile
set visualbell
set errorbells

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对易采站长站的支持。如果你想了解更多相关内容请查看下面相关链接