aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nvim/.config/nvim/init.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim
index e37a544..9c6f1bd 100644
--- a/nvim/.config/nvim/init.vim
+++ b/nvim/.config/nvim/init.vim
@@ -210,6 +210,9 @@ Plugin 'tpope/vim-sleuth'
" Indentation for working on salt files
Plugin 'saltstack/salt-vim'
+" Workspace manager
+Plugin 'andreyorst/SimpleWorkspaces.vim'
+
" markdown prev
" https://github.com/iamcco/markdown-preview.nvim/issues/43
" Vundle don't support plugin hook so need to run :call mkdp#util#install()
@@ -310,6 +313,23 @@ map <C-b> :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
+
+function! NERDTreeToggleInCurDir()
+ " If NERDTree is open in the current buffer
+ if (exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1)
+ exe ":NERDTreeClose"
+ else
+ if (expand("%:t") != '')
+ exe ":NERDTreeFind"
+ else
+ exe ":NERDTreeCWD"
+ endif
+ endif
+endfunction
+
+" nnoremap <leader>nf :NERDTreeFind<cr>
+nnoremap <C-b> :call NERDTreeToggleInCurDir()<cr>
+
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg