vim-sandwich
vim-sandwich copied to clipboard
How to disable vim-sandwich inside NERDTree?
I commonly open files into vertically-split windows using NERDTree, which has s mapped for this purpose.
Now that I have vim-sandwich, pressing s inside NERDtree is very slow as it's waiting to see if I'm going to complete a vim-sandwich command before it opens the split.
Is there anyway to disable vim-sandwich inside windows like NERDTree? Perhaps if the buffer has modifiable set to off (which is what NERDTree windows are), then vim-sandwich could be disabled for that window?
There are several ways to achieve it but maybe the use of <nowait> option for s key-mapping would be the easiest in your case. NERDTree doesn't provide <Plug> key-mappings, so it may look a little lengthy:
augroup NERDTree-disable-sandwich
autocmd FileType nerdtree nnoremap <buffer><nowait> s :call nerdtree#ui_glue#invokeKeyMap('s')<CR>
augroup END
Add this lines to your vimrc, then your s in nerdtree window works immediately. The augroup name is whatever you like is ok.