From c14e7e61344d67d4233beb9f1e7a9f314d2b22f5 Mon Sep 17 00:00:00 2001 From: neodarz Date: Wed, 4 Sep 2019 14:37:17 +0200 Subject: Add workspace system --- cheat/.cheat/vim | 4 ++++ nvim/.config/nvim/init.vim | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) 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 :NERDTreeToggle 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 nf :NERDTreeFind +nnoremap :call NERDTreeToggleInCurDir() + " 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 -- cgit v1.2.1