centOS vim插件全套配置
时间: 2023-07-26 14:48:04 浏览: 169
以下是一个基于Vundle插件管理器的完整vim插件配置样例,包含常用插件和快捷键绑定等:
```
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Add your plugins here
Plugin 'scrooloose/nerdtree' " 文件树
Plugin 'tpope/vim-fugitive' " Git
Plugin 'jiangmiao/auto-pairs' " 自动补全括号
Plugin 'vim-airline/vim-airline' " 状态栏
Plugin 'vim-airline/vim-airline-themes' " 状态栏主题
Plugin 'tpope/vim-surround' " 快捷键快速包围文本
Plugin 'tpope/vim-repeat' " 使 . 命令支持插件操作
Plugin 'tpope/vim-commentary' " 快速注释
Plugin 'preservim/nerdcommenter' " 快速注释
Plugin 'vim-scripts/indentpython.vim' " Python缩进
Plugin 'SirVer/ultisnips' " 代码片段
Plugin 'honza/vim-snippets' " 代码片段
Plugin 'fatih/vim-go' " Golang 工具
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" 定义快捷键
nnoremap <C-n> :NERDTreeToggle<CR> " 打开/关闭文件树
nnoremap <leader>gs :Git<CR> " 打开 Git 窗口
nnoremap <leader>gb :Git blame<CR> " Git blame
nnoremap <leader>gc :Git commit<CR> " Git commit
nnoremap <leader>gd :Gdiff<CR> " Git diff
nnoremap <leader>gl :Glog<CR> " Git log
nnoremap <leader>gp :Git push<CR> " Git push
nnoremap <leader>gs :Gstatus<CR> " Git status
nnoremap <leader>gw :Gwrite<CR> " Git write
" 设置状态栏主题
let g:airline_theme='molokai'
```
保存并退出`~/.vimrc`文件,然后打开vim,执行以下命令,安装配置好的插件:
```
:PluginInstall
```
Vundle将自动从GitHub上下载和安装已列出的插件。
至此,你的vim插件全套配置已完成。
阅读全文