Add List command

Searches for a pattern and adds all occurrences to the location list
This commit is contained in:
Talia 2018-08-23 10:58:18 +02:00
parent 735ce08422
commit 217cd1fb31

2
vimrc
View file

@ -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')