Skip to content

Commit 63a6b23

Browse files
author
Yoonsang Lee
committed
Add 'find' type cmd
1 parent 0a71869 commit 63a6b23

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

plugin/VIntSearch.vim

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,25 @@ command! -complete=tag -nargs=1 VSctags call VIntSearch#SearchRaw(<f-args>,'ctag
8383

8484
" You can put grep options into <f-args>
8585
" ex) :Vsgrep -i tags
86+
" :Vsgrep tags -i
8687
" :Vsgrep -i "let tags"
88+
" :Vsgrep "let tags" -i
8789
command! -complete=tag -nargs=1 VIntSearchGrep call VIntSearch#SearchRaw(<f-args>,'grep')
8890
command! -complete=tag -nargs=1 VSgrep call VIntSearch#SearchRaw(<f-args>,'grep')
8991

9092
command! -complete=tag -nargs=1 VIntSearchCFGrep call VIntSearch#SearchRaw(<f-args>,'cfgrep')
9193
command! -complete=tag -nargs=1 VScfgrep call VIntSearch#SearchRaw(<f-args>,'cfgrep')
9294

95+
command! -complete=tag -nargs=1 VIntSearchFind call VIntSearch#SearchRaw(<f-args>,'find')
96+
command! -complete=tag -nargs=1 VSfind call VIntSearch#SearchRaw(<f-args>,'find')
97+
9398
"""""""""""""""""
9499
" search commands with cursor
95100

96101
command! -complete=tag -nargs=* VIntSearchCtagsCursor call VIntSearch#SearchCursor('ctags',<f-args>)
97102
command! -complete=tag -nargs=* VIntSearchGrepCursor call VIntSearch#SearchCursor('grep',<f-args>)
98103
command! -complete=tag -nargs=* VIntSearchCFGrepCursor call VIntSearch#SearchCursor('cfgrep',<f-args>)
104+
command! -complete=tag -nargs=* VIntSearchFindCursor call VIntSearch#SearchCursor('find',<f-args>)
99105

100106
"""""""""""""""""
101107
" stack commands
@@ -125,11 +131,11 @@ command! VIntSearchJumpCursorGrep call VIntSearch#SearchDep('VIntSearchJumpCurso
125131
command! VIntSearchListCursorCtags call VIntSearch#SearchDep('VIntSearchListCursorCtags', expand('<cword>'),'ctags','',0,0,1,1)
126132
command! VIntSearchListCursorGrep call VIntSearch#SearchDep('VIntSearchListCursorGrep', expand('<cword>'),'grep','-wF',0,0,1,1)
127133

128-
command! VIntSearchJumpSelectionCtags call VIntSearch#SearchDep('VIntSearchJumpSelectionCtags', s:get_visual_selection(),'ctags','',0,1,0,1)
129-
command! VIntSearchJumpSelectionGrep call VIntSearch#SearchDep('VIntSearchJumpSelectionGrep', s:get_visual_selection(),'grep','-F',1,1,0,1)
134+
command! VIntSearchJumpSelectionCtags call VIntSearch#SearchDep('VIntSearchJumpSelectionCtags', s:get_visual_selection_dep(),'ctags','',0,1,0,1)
135+
command! VIntSearchJumpSelectionGrep call VIntSearch#SearchDep('VIntSearchJumpSelectionGrep', s:get_visual_selection_dep(),'grep','-F',1,1,0,1)
130136

131-
command! VIntSearchListSelectionCtags call VIntSearch#SearchDep('VIntSearchListSelectionCtags', s:get_visual_selection(),'ctags','',0,0,1,1)
132-
command! VIntSearchListSelectionGrep call VIntSearch#SearchDep('VIntSearchListSelectionGrep', s:get_visual_selection(),'grep','-F',1,0,1,1)
137+
command! VIntSearchListSelectionCtags call VIntSearch#SearchDep('VIntSearchListSelectionCtags', s:get_visual_selection_dep(),'ctags','',0,0,1,1)
138+
command! VIntSearchListSelectionGrep call VIntSearch#SearchDep('VIntSearchListSelectionGrep', s:get_visual_selection_dep(),'grep','-F',1,0,1,1)
133139

134140
command! -complete=tag -nargs=1 VIntSearchListTypeCtags call VIntSearch#SearchRawDep('VIntSearchListTypeCtags', <f-args>,'ctags',0,1,1)
135141

@@ -139,15 +145,15 @@ command! -complete=tag -nargs=1 VIntSearchListTypeCtags call VIntSearch#SearchRa
139145
command! -complete=tag -nargs=1 VIntSearchListTypeGrep call VIntSearch#SearchRawDep('VIntSearchListTypeGrep', <f-args>,'grep',0,1,1)
140146

141147
command! VIntSearchListCursorGrepLocal call VIntSearch#SearchDep('VIntSearchListCursorGrepLocal', expand('<cword>'),'grep','-wF',0,0,1,1,expand('%:p'))
142-
command! VIntSearchListSelectionGrepLocal call VIntSearch#SearchDep('VIntSearchListSelectionGrepLocal', s:get_visual_selection(),'grep','-F',1,0,1,1,expand('%:p'))
148+
command! VIntSearchListSelectionGrepLocal call VIntSearch#SearchDep('VIntSearchListSelectionGrepLocal', s:get_visual_selection_dep(),'grep','-F',1,0,1,1,expand('%:p'))
143149

144150
command! -complete=tag -nargs=1 VIntSearchListTypeGrepLocal call VIntSearch#SearchRawDep('VIntSearchListTypeGrepLocal', <f-args>,'grep',0,1,1,expand('%:p'))
145151

146152
"""""""""""""""""""""""""""""""""""""""""""""
147153
" utility function
148154

149155
" thanks for xolox!
150-
function! s:get_visual_selection()
156+
function! s:get_visual_selection_dep()
151157
" Why is this not a built-in Vim script function?!
152158
let [lnum1, col1] = getpos("'<")[1:2]
153159
let [lnum2, col2] = getpos("'>")[1:2]

0 commit comments

Comments
 (0)