diff options
| author | Teddy Wing | 2018-04-08 00:07:21 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-04-08 00:07:21 +0200 | 
| commit | 6fa50980ca86b00de5629cafe96a85280f2b0c1b (patch) | |
| tree | 1ec769113ce4668c32ea3ad7f6b2cd51060023ef | |
| parent | a9960f29cef722d0eef68ca3eb7963fe9dbadc26 (diff) | |
| download | vim-tabs-grep-6fa50980ca86b00de5629cafe96a85280f2b0c1b.tar.bz2 | |
Echo tabs with "Tab page X" lines highlighted in the "Title" group
Makes the "Tab page X" lines appear in the same colour as they usually
do when using the `:tabs` command.
| -rw-r--r-- | plugin/tabs_grep.vim | 17 | 
1 files changed, 14 insertions, 3 deletions
| diff --git a/plugin/tabs_grep.vim b/plugin/tabs_grep.vim index 644bf44..d9abe40 100644 --- a/plugin/tabs_grep.vim +++ b/plugin/tabs_grep.vim @@ -9,9 +9,8 @@ function! TabsGrep(search)  	call filter(tabs, function('s:MatchString', [a:search]))  	let tabs = s:FilterTabPageElements(tabs) -	for line in tabs -		echo line -	endfor + +	call s:EchoTabs(tabs)  endfunction  function! s:MatchString(search, index, value) @@ -61,4 +60,16 @@ function! s:FilterTabPageElements(list)  	return a:list  endfunction +function! s:EchoTabs(tab_list) +	for line in a:tab_list +		if s:IsTabPageLine(line) +			echohl Title +			echo line +			echohl None +		else +			echo line +		endif +	endfor +endfunction +  command! -nargs=1 TabsGrep :call TabsGrep(<f-args>) | 
