aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-04 14:37:17 +0200
committerneodarz <neodarz@neodarz.net>2019-09-04 14:37:17 +0200
commitc14e7e61344d67d4233beb9f1e7a9f314d2b22f5 (patch)
treefea4244e44549c1129c078fa1bf8e2f1447c7b1b /nvim
parent796fe9137c955360f44dde649f3ba711f288faa9 (diff)
downloaddotfiles_ascii-c14e7e61344d67d4233beb9f1e7a9f314d2b22f5.tar.xz
dotfiles_ascii-c14e7e61344d67d4233beb9f1e7a9f314d2b22f5.zip
Add workspace system
Diffstat (limited to 'nvim')
-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