-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c9e14cd
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This is almost a copypaste of http://www.vim.org/scripts/script.php?script_id=3878 | ||
|
||
This plugin add capability to search in folders via NERDtree. The search use [ag.vim](https://github.com/epmatsw/ag.vim). | ||
|
||
## How to Use | ||
|
||
1. Open NERDtree | ||
2. Point to a directory | ||
3. Press `ms` | ||
4. Enter search term | ||
5. Profit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
" ============================================================================ | ||
" File: NERD_tree-ack.vim | ||
" Description: Adds searching capabilities to NERD_Tree | ||
" Maintainer: Mohammad Satrio <wolfaeon at gmail dot com> | ||
" License: This program is free software. It comes without any warranty, | ||
" to the extent permitted by applicable law. You can redistribute | ||
" it and/or modify it under the terms of the Do What The Fuck You | ||
" Want To Public License, Version 2, as published by Sam Hocevar. | ||
" See http://sam.zoy.org/wtfpl/COPYING for more details. | ||
" | ||
" ============================================================================ | ||
|
||
|
||
" don't load multiple times | ||
if exists("g:loaded_nerdtree_ag") | ||
finish | ||
endif | ||
|
||
let g:loaded_nerdtree_ag = 1 | ||
|
||
" add the new menu item via NERD_Tree's API | ||
call NERDTreeAddMenuItem({ | ||
\ 'text': '(s)earch directory', | ||
\ 'shortcut': 's', | ||
\ 'callback': 'NERDTreeAg' }) | ||
|
||
function! NERDTreeAg() | ||
" get the current dir from NERDTree | ||
let cd = g:NERDTreeDirNode.GetSelected().path.str() | ||
|
||
" get the pattern | ||
let pattern = input("Enter the pattern: ") | ||
if pattern == '' | ||
echo 'Maybe another time...' | ||
return | ||
endif | ||
exec "Ag ".pattern." ".cd | ||
endfunction |