Add List command
Searches for a pattern and adds all occurrences to the location list
This commit is contained in:
parent
735ce08422
commit
217cd1fb31
1 changed files with 2 additions and 0 deletions
2
vimrc
2
vimrc
|
@ -261,6 +261,8 @@ function! MatchingLinesDict(pattern)
|
||||||
silent! exec "g/".a:pattern."/ call s:mld_helper(list, a:pattern)"
|
silent! exec "g/".a:pattern."/ call s:mld_helper(list, a:pattern)"
|
||||||
return list
|
return list
|
||||||
endfunc
|
endfunc
|
||||||
|
com! -nargs=1 List call setloclist(0, MatchingLinesDict(<f-args>))
|
||||||
|
\ | lopen
|
||||||
|
|
||||||
function! LocationAddLineCol(filename, lnum, text, col)
|
function! LocationAddLineCol(filename, lnum, text, col)
|
||||||
call setloclist(0, [{'filename': a:filename, 'lnum': a:lnum, 'desc': a:text, 'col': a:col}], 'a')
|
call setloclist(0, [{'filename': a:filename, 'lnum': a:lnum, 'desc': a:text, 'col': a:col}], 'a')
|
||||||
|
|
Loading…
Reference in a new issue