Vim 插件 主题
SpaceVim 1 curl -sLf https://spacevim.org/install.sh | bash
Vundle 插件管理器 Vundle 是Vim bundle 的简称,是一个 Vim 插件管理器.
Vundle 允许你做
在.vimrc中跟踪和管理插件 安装特定格式的插件(a.k.a. scripts/bundle) 更新特定格式插件 通过插件名称搜索Vim scripts中的插件 清理未使用的插件 可以通过单一按键完成以上操作,详见interactive mode 安装
1 git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
编辑 添加下列内容 1 2 3 4 5 6 7 set nocompatible filetype off set rtp+=~/.vim /bundle/Vundle.vim call vundle#begin()Plugin 'VundleVim/Vundle.vim' call vundle#end() filetype plugin indent on
安装需要的插件
1 vim +PluginInstall +qall
安装 Markdown 插件 修改vimrc配置文件,添加
1 2 Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown'
下一步
安装 gruvbox 主题 在 .vimrc 添加
1 2 Plugin 'morhetz/gruvbox' Plugin 'vim-airline/vim-airline'
配置主题
1 2 3 4 set bg=dark "设置背景为黑色 colorscheme gruvbox "设置主题为 gruvbox set guioptions= "去掉两边的scrollbar set guifont=Monaco:h17 "设置字体和字的大小
Vim-airline .vimrc 添加插件
1 2 Plugin 'vim-airline/vim-airline Plugin ' vim -airline/vim -airline-themes'
配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 "" airline settings.let g:airline_theme = 'simple' let g:airline_powerline_fonts = 1 if !exists('g:airline_symbols' ) let g:airline_symbols = {} endif let g:airline_left_sep = '' let g:airline_left_alt_sep = '' let g:airline_right_sep = '' let g:airline_right_alt_sep = '' let g:airline_symbols .branch = '' let g:airline_symbols .readonly = '' let g:airline_symbols .linenr = '' let g:airline #extensions#tabline#enabled = 1 let g:airline_section_c = '%<%F%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#' let g:airline #extensions#tabline#tab_nr_type = 1
支持主题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 badwolf base16 behelit bubblegum dark durant hybridline hybrid jellybeans kalisi kolor laederon light lucius luna molokai monochrome murmur papercolor powerlineish raven serene silver simple solarized sol term tomorrow ubaryd understated wombat zenburn
NERD Tree 文件浏览插件 .vimrc 添加插件
1 Plugin 'scrooloose/nerdtree'
打开/关闭 NERD Tree
NERD Tree 配置
1 2 3 4 5 autocmd StdinReadPre * let s:std_in =1 autocmd VimEnter * if argc () == 0 && !exists("s:std_in" ) | NERDTree | endif nmap ,d :NERDTreeToggle<CR>
使用技巧
按 ?
可以打开 NERD tree 帮助文档 按 j
,k
在 NERD tree上下移动,<c-r>
打开关闭文件夹或文件 :vsp
在右侧打开一个分屏,:sp
在下面打开一个分屏<c-w>j
,<c-w>k
, <c-w>h
, <c-w>l
按键分别向上、下、左、右分屏移动。 <c-w>=
均分屏幕改默的切换分屏按键方式
1 2 3 4 5 "--------- Split Mapping --------------------" nmap <c-j> <c-w> j nmap <c-k> <c-w> k nmap <c-h> <c-w> hnmap <c-l> <c-w> l
.vimrc 配置文件 vimrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 set number set relativenumberset rulerset fileencodings=utf-8 ,gb2312,gb18030,gbk,ucs-bom,cp936,latin1set fileencoding=utf-8 set encoding=utf-8 set fencs=utf-8 ,gbk,gb2312,gb18030syntax enablesyntax on hi pythonSelf ctermfg=174 guifg=#6094 DB cterm=bold gui =boldlet python_highlight_all=1 syntax enablehighlight StatusLine guifg=SlateBlue guibg=Yellowhighlight StatusLineNC guifg=Gray guibg=Whiteset wildmenuset laststatus=2 set wildmenuset tabstop=4 filetype plugin indent on set autoindentset cindent set smartindentset shiftwidth =4 nmap <C-H> <C-W> hnmap <C-J> <C-W> j nmap <C-K> <C-W> k nmap <C-L> <C-W> l set nocompatible filetype off set rtp+=~/.vim /bundle/Vundle.vim call vundle#begin()Plugin 'VundleVim/Vundle.vim' Plugin 'morhetz/gruvbox' Plugin 'vim-airline/vim-airline' Plugin 'plasticboy/vim-markdown' call vundle#end() filetype plugin indent on set bg=dark colorscheme gruvbox set guioptions= set guifont=Monaco:h17 set cucset culset incsearch set ignorecaseset hlsearch let g:airline_theme = 'simple' let g:airline_powerline_fonts = 1 if !exists('g:airline_symbols' ) let g:airline_symbols = {} endif let g:airline_left_sep = '' let g:airline_left_alt_sep = '' let g:airline_right_sep = '' let g:airline_right_alt_sep = '' let g:airline_symbols .branch = '' let g:airline_symbols .readonly = '' let g:airline_symbols .linenr = '' let g:airline #extensions#tabline#enabled = 1 let g:airline_section_c = '%<%F%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#' let g:airline #extensions#tabline#tab_nr_type = 1
参考