1
我刚开始使用EasyGrep。当我进行搜索时,我的NERDTree窗口常常处于焦点状态,并且第一个搜索结果将加载到此窗口中。防止在NerdTree窗口中打开grep结果
有没有办法强制EasyGrep打开主缓冲窗口中的第一个结果?
谢谢!
我刚开始使用EasyGrep。当我进行搜索时,我的NERDTree窗口常常处于焦点状态,并且第一个搜索结果将加载到此窗口中。防止在NerdTree窗口中打开grep结果
有没有办法强制EasyGrep打开主缓冲窗口中的第一个结果?
谢谢!
以下是我在.vimrc
补充说:
function! SearchOutsideOfNerdtree()
if &filetype == 'nerdtree'
:wincmd l
endif
:execute input("", ":Grep\<Space>")
endfunction
function! ReplaceOutsideOfNerdtree()
if &filetype == 'nerdtree'
:wincmd l
endif
:execute input("", ":Replace\<Space>")
endfunction
nnoremap <Leader>f :call SearchOutsideOfNerdtree()<CR>
nnoremap <Leader>g :call ReplaceOutsideOfNerdtree()<CR>
基本上,我创建了一个检查,如果当前文件类型为nerdtree
,我向右移动,缓冲功能。
以下是我在我的.vimrc添加和它的作品:
nnoremap <silent> ,g :<C-u>wincmd w<CR>:Unite grep:. -buffer-name=search-buffer<CR>
Vim有[没有项目抽屉的概念(http://vimcasts.org/blog/2013/01/oil-and -vinegar-split-windows-and-project-drawer /),所以我怀疑有很多方法可以在不改变工作流程或向EasyGrep提交问题的情况下避免此行为。 –