call plug#begin('~/.vim/plugged') "在这里使用 Plug "github用户/项目名" 的方式引入插件 "Import plugin by using Plug "github_username/project_name"
"彩虹括号 "Rainbow bracket Plug 'luochen1990/rainbow'
"历史记录 "History record "Plug 'mhinz/vim-startify'
"One Dark Theme Plug 'joshdick/onedark.vim' call plug#end()
"设置配色,这里选择的是 desert,也有其他方案,在 vim 中输入 :color 再敲 tab 键可以查看 "Set color. Here is desert by default. Type :color in vim and press tab to view other options "color desert color onedark
"设置背景色,每种配色有两种方案,一个 light、一个 dark "Set background each of which has two mode, light and dark set background=dark
letg:rainbow_active = 1"0 if you want to enable it later via :RainbowToggle
"传说中的去掉边框用下边这一句 "Remove border setgo=
"打开语法高亮 "Turn on syntax highlighting syntaxon
"显示行号 "Show line number setnumber
"设置缩进有三个取值 cindent(C 风格)、smartindent(智能模式,其实不觉得有什么智能)、autoindent(简单的与上一行保持一致) "Set Indent with three values: cindent/、smartindent/、autoindent setcindent
"用空格键替换制表符 "Replace tabs with the space bar :set expandtab
"制表符占 4 个空格 "Tabs take up 4 spaces set tabstop=4
"默认缩进 4 个空格大小 "The default indent size is 4 spaces setshiftwidth=4
"增量式搜索 "Incremental search set incsearch
"高亮搜索 "Highlight search set hlsearch
"有时中文会显示乱码,用一下几条命令解决 "Solve Chinese garbled code let &termencoding=&encoding set fileencodings=utf-8,gbk
"很多插件都会要求的配置检测文件类型 "Check file type :filetypeon :filetype plugin on :filetypeindenton
"下边这个很有用可以根据不同的文件类型执行不同的命令 "Run different commands based on different file types "例如:如果是 C/C++ 类型 "For example, if for C/C++ :autocmd FileType c,cpp :set foldmethod=syntax :autocmd FileType c,cpp :setnumber :autocmd FileType c,cpp :setcindent
"例如:如果是 Python 类型 "For example, if for Python :autocmd FileType python :setnumber :autocmd FileType python :set foldmethod=syntax :autocmd FileType python :set smartindent
Vim Plugin Commands
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<!-- Install specific plugin such as --> <!-- :PlugInstall gist-vim --> :PlugInstall <plugin_name> <!-- Install all plugins specified in .vimrc --> :PlugInstall
<!-- Remove plugin --> <!-- Note that removeor comment out plugin configuration in .vimrc in advance --> :PlugClean <plugin_name>
<!-- Udgrade vim-plug itself --> :PlugUpgrade
<!-- Update all plugins --> :PlugUpdate
<!-- Review the infomation of installed plugin --> :PlugStatus <plugin_name>