From f11e94a3d929f6218aa21da8a3258711431e0c68 Mon Sep 17 00:00:00 2001 From: "Yevgeniy A. Viktorov" Date: Sun, 13 Feb 2011 10:17:00 +0200 Subject: [PATCH] simplifying implementation through Ack.vim plugin --- plugin/NERD_tree_ACK.vim | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/plugin/NERD_tree_ACK.vim b/plugin/NERD_tree_ACK.vim index 15285fd..0691485 100644 --- a/plugin/NERD_tree_ACK.vim +++ b/plugin/NERD_tree_ACK.vim @@ -19,12 +19,6 @@ endif let g:loaded_nerdtree_ack = 1 -if !exists("g:path_to_search_app") - let g:path_to_search_app = "ack" -endif - -let g:path_to_search_app = g:path_to_search_app . "\\ -H\\ --nocolor\\ --nogroup" - " add the new menu item via NERD_Tree's API call NERDTreeAddMenuItem({ \ 'text': '(s)earch directory', @@ -45,19 +39,13 @@ function! NERDTreeAck() " display first result in the last window wincmd w - let grepprg_bak = &grepprg - exec "set grepprg=" . g:path_to_search_app - exec 'silent! grep ' . pattern . ' ' . cd - - let &grepprg=grepprg_bak - exec "redraw!" + exec 'Ack ' . pattern . ' ' . cd let hits = len(getqflist()) if hits == 0 echo 'Pattern ' . pattern . ' not found in ' . cd elseif hits > 1 echo 'Found ' . hits . ' hits. Use the menu to navigate!' - botright copen endif endfunction