set up nerdtree plugin

This commit is contained in:
Marty Oehme 2019-03-20 16:13:18 +01:00
parent c194d134e3
commit 961e6d1c6c

View file

@ -43,7 +43,7 @@ Plug 'jiangmiao/auto-pairs' " Auto close brackets and ''
" Ecosystem
" Plug 'tpope/vim-fugitive' - Will have to take a closer look some other time
Plug 'scrooloose/nerdtree' " directory thingy - perhaps replace it with something more efficient
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " show a directory listing within vim
Plug 'Yggdroot/LeaderF' " fuzzy matcher, apparently faster than fzf, ctrlp, unit, denite
" Language Integration
@ -75,6 +75,49 @@ endif
" ================================================================================
" PLUGIN CONFIGURATION {{{
" ================================================================================
" PLUGIN: NERDTree
" highlight the line the cursor is on
let NERDTreeHighlightCursorline = 1
" remove Press ? for help
let NERDTreeMinimalUI=1
" loads nerdtree plugin when starting vim with a directory
" this is necessary when we lazyload nerdtree with vimplug above
" since it would only get loaded with nttoggle otherwise, and run netrw
augroup nerd_loader
autocmd!
autocmd VimEnter * silent! autocmd! FileExplorer
autocmd BufEnter,BufNew *
\ if isdirectory(expand('<amatch>'))
\| call plug#load('nerdtree')
\| execute 'autocmd! nerd_loader'
\| endif
augroup END
" PLUGIN: DEOPLETE
" enable deoplete at startup
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#enable_camel_case = 1
let g:deoplete#enable_refresh_always = 1
let g:deoplete#max_abbr_width = 0
let g:deoplete#max_menu_width = 0
let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})
" PLUGIN: ALE
let g:ale_fix_on_save = 1
let g:ale_fixers = {
\'javascipt': ['eslint', 'prettier'],
\'html': ['tidy','prettier'],
\'typescript': ['prettier','tslint'],
\'*': ['remove_trailing_lines', 'trim_whitespace'],
\}
" PLUGIN: AIRLINE
" PLUGIN: TMUXLINE
let g:airline_powerline_fonts=1
let g:airline_theme='raven'
colorscheme allomancer
@ -98,24 +141,6 @@ let g:tmuxline_preset = {
" automatically save the current buffer when navigating away from vim
let g:tmux_navigator_save_on_switch = 1
" enable deoplete at startup
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#enable_camel_case = 1
let g:deoplete#enable_refresh_always = 1
let g:deoplete#max_abbr_width = 0
let g:deoplete#max_menu_width = 0
let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})
let g:ale_fix_on_save = 1
let g:ale_fixers = {
\'javascipt': ['eslint', 'prettier'],
\'html': ['tidy','prettier'],
\'typescript': ['prettier','tslint'],
\'*': ['remove_trailing_lines', 'trim_whitespace'],
\}
" }}}
" ================================================================================
" VIM SETTINGS {{{
@ -207,8 +232,13 @@ nnoremap <leader>T :tabedit .<cr>
" save current buffer with Ctrl-s
nnoremap <C-s> :w<cr>
" open NERDtree with leader-e
" open/close NERDtree with leader-e
" whatever method tree has been opened by, leader-e closes it again
nnoremap <leader>e :NERDTreeToggle<CR>
" open root of current VCS project in tree
nnoremap <leader><C-e> :NERDTreeVCS<CR>
" open current nerdtree with current file highlighted
nnoremap <leader>E :NERDTreeFind<CR>
" }}}
" ================================================================================