Skip to content
Browse files

- Added g:unite_source_grep_recursive_opt.

  • Loading branch information...
1 parent 7c9cd18 commit 820867ac6099ef7fe5bab04aa8675fb017952689 @Shougo Shougo committed Jun 17, 2011
Showing with 10 additions and 3 deletions.
  1. +4 −3 autoload/unite/sources/grep.vim
  2. +6 −0 doc/unite-grep.txt
View
7 autoload/unite/sources/grep.vim
@@ -28,6 +28,7 @@
" Variables "{{{
call unite#util#set_default('g:unite_source_grep_command', 'grep')
call unite#util#set_default('g:unite_source_grep_default_opts', '-Hn')
+call unite#util#set_default('g:unite_source_grep_recursive_opt', '-R')
call unite#util#set_default('g:unite_source_grep_max_candidates', 100)
"}}}
@@ -49,7 +50,7 @@ let s:action_grep_directory = {
\ 'is_selectable': 1,
\ }
function! s:action_grep_directory.func(candidates) "{{{
- call unite#start([['grep', map(copy(a:candidates), 'v:val.action__directory'), '-R']])
+ call unite#start([['grep', map(copy(a:candidates), 'v:val.action__directory'), g:unite_source_grep_recursive_opt]])
endfunction "}}}
if executable(g:unite_source_grep_command) && unite#util#has_vimproc()
call unite#custom_action('file,buffer', 'grep', s:action_grep_file)
@@ -85,9 +86,9 @@ function! s:grep_source.hooks.on_init(args, context) "{{{
elseif l:target ==# '$buffers'
let l:target = join(map(filter(range(1, bufnr('$')), 'buflisted(v:val)'),
\ 'unite#util#escape_file_searching(bufname(v:val))'))
- elseif l:target == '**' && g:unite_source_grep_command ==# 'grep'
+ elseif l:target == '**'
" Optimized.
- let l:target = '* -R'
+ let l:target = '* ' . g:unite_source_grep_recursive_opt
endif
let a:context.source__target = [l:target]
View
6 doc/unite-grep.txt
@@ -68,6 +68,11 @@ g:unite_source_grep_command *g:unite_source_grep_command*
Default value is "grep".
+g:unite_source_grep_recursive_opt *g:unite_source_grep_recursive_opt*
+ Set grep recursive option.
+
+ Default value is "-R".
+
g:unite_source_grep_default_opts *g:unite_source_grep_default_opts*
Set grep default options.
Note: grep output must be this pattern.
@@ -98,6 +103,7 @@ CHANGELOG *unite-grep-changelog*
2011-06-17
- Fixed unite actions.
+- Added g:unite_source_grep_recursive_opt.
2011-06-13
- Improved perfomance.

0 comments on commit 820867a

Please sign in to comment.
Something went wrong with that request. Please try again.