let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾'
配置就是官方的,包含自动关闭最后一个窗口。并没有做很多的美化。
常见问题
如果在关闭 tab 时出现:
Error detected while processing BufEnter Autocommands for “*”:
Press ENTER or type command to continue
这是因为官方的 README.md 是过时的。将 “Close the tab if NERDTree is the only window remaining in it.“ 的命令更换为如下的:
1 2
" Close the tab if NERDTree is the only window remaining in it. autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
" don't show the help in normal mode let g:Lf_HideHelp = 1 let g:Lf_UseCache = 0 let g:Lf_UseVersionControlTool = 0 let g:Lf_IgnoreCurrentBufferName = 1 " popup mode let g:Lf_WindowPosition = 'popup' let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" } let g:Lf_PreviewResult = {'Function': 0, 'BufTag': 0 }
let g:Lf_ShortcutF = "<C-f>" let g:Lf_DefaultExternalTool='rg'
let g:Lf_WorkingDirectoryMode = 'AF' let g:Lf_RootMarkers = ['.git', '.svn', '.hg', '.project', '.root']
" Make <CR> to accept selected completion item or notify coc.nvim to format " <C-g>u breaks current undo, please make your own choice inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction
let g:syntastic_c_checkers=['clang_tidy'] let g:syntastic_cpp_checkers=['clang_tidy'] let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0
let mapleader="\<space>" nnoremap <leader>ev :vsp $MYVIMRC<CR> nnoremap <leader>sv :source $MYVIMRC<CR>
"Begin of LeaderF"
" don't show the help in normal mode let g:Lf_HideHelp = 1 let g:Lf_UseCache = 0 let g:Lf_UseVersionControlTool = 0 let g:Lf_IgnoreCurrentBufferName = 1 " popup mode let g:Lf_WindowPosition = 'popup' let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" } let g:Lf_PreviewResult = {'Function': 0, 'BufTag': 0 }
let g:Lf_ShortcutF = "<C-f>" let g:Lf_DefaultExternalTool='rg'
let g:Lf_WorkingDirectoryMode = 'AF' let g:Lf_RootMarkers = ['.git', '.svn', '.hg', '.project', '.root']
" Make <CR> to accept selected completion item or notify coc.nvim to format " <C-g>u breaks current undo, please make your own choice inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction