diff options
Diffstat (limited to '')
-rw-r--r-- | cheat/.cheat/vim | 4 | ||||
-rw-r--r-- | nvim/.config/nvim/init.vim | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/cheat/.cheat/vim b/cheat/.cheat/vim index e56d394..ebc509d 100644 --- a/cheat/.cheat/vim +++ b/cheat/.cheat/vim @@ -74,3 +74,7 @@ d{motion} delete text that {motion} moves over # Use normal copy pase `"`; `+` ; `y` <= yank `"`; `+` ; `p` <= paste + +# SimpleWorkspaces.vim +To add the current dir in a Workspace: `:WorkspaceInit` +And save it in a better name: `:WorkspaceSave {name}` 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 |