1. nerdtree 生成文件目录树
1
2
|
" 文件目录树
Plugin 'scrooloose/nerdtree'
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
"=====================================================
"" NERDTree 配置
"=====================================================
let NERDTreeChDirMode=1
"显示书签"
let NERDTreeShowBookmarks=1
"设置忽略文件类型"
let NERDTreeIgnore=['~$', '.pyc$', '.swp$','.pyo$', '__pycache__$']
"窗口大小"
let NERDTreeWinSize=40
autocmd VimEnter * if !argc() | NERDTree | endif " Load NERDTree only if vim is run without arguments
"按 F2 开启和关闭目录树"
map <F2> :NERDTreeToggle<CR>
|
常用快捷键
快捷键操作
ctrl + w + w |
光标自动在左右侧窗口切换 |
o |
展开左侧某个目录,再按一下就是合并目录 |
t |
在新 Tab 中打开选中文件/书签,并跳到新 Tab |
T |
在新 Tab 中打开选中文件/书签,但不跳到新 Tab |
P |
跳到根结点 |
q |
关闭 NerdTree 窗口 |
:tabc |
关闭当前的 tab |
:tabo |
关闭所有其他的 tab |
效果图:
2. vim-colorschemes 自定义显示主题
flazz/vim-colorschemes 内置了很多配色方案,可以自行选择。
1
2
|
" 主题
Plugin 'flazz/vim-colorschemes'
|
1
2
3
4
5
6
|
"=====================================================
"" Vim-colorschemes 配置
"=====================================================
syntax enable " syntax highlight
set t_Co=256 " set 256 colors
colorscheme wombat256mod " set color scheme
|
效果图:
3. vim-airline 状态条
bling/vim-airline 用于定制强化状态条。
1
2
|
" 状态条
Plugin 'bling/vim-airline'
|
1
2
3
4
5
6
7
8
9
10
|
"=====================================================
"" vim-airline 配置
"=====================================================
set t_Co=256 " Explicitly tell Vim that the terminal supports 256 colors
set laststatus=2
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1 " enable tabline
let g:airline#extensions#tabline#buffer_nr_show=1 " 显示buffer行号
let g:airline_theme="solarized"
"set ambiwidth=double " When iTerm set double-width characters, set it
|
效果图:
4. tagbar 代码分析
majutsushi/tagbar 可以快速的分析代码的函数、类定义。首先得安装下 ctag,在 Windows 下可以执行: choco install ctags
1
2
|
" 代码分析
Plugin 'majutsushi/tagbar'
|
1
2
3
4
|
"=====================================================
"" tagbar 配置
"=====================================================
nmap <F8> :TagbarToggle<CR>
|
效果图:
5. ag.vim 内容查找
rking/ag.vim 是一个查找速度比 ack 还要快的搜索插件。首先得安装下 ag,在 Windows 下可以执行: choco install ag
1
2
|
" 内容查找
Plugin 'rking/ag.vim'
|