On March 21, 2013 6:52 PM, Axel Bender wrote:
> How about implementing a highlighting of the pattern searched for in
:g/.../
> expressions? At times the resulting list is quite long and it is difficult
to
> identify the pattern. Highlighting it would be of great benefit (at least
for
> me...).
First of all, I apologize for violating the "mailing rule."
I think my previous e-mail is somehow strange-looking unlike others'. But I
didn't recognize the problem. Sorry for the confusion.
I want to suggest to use ':grep' for searching the text and highlighting
them.
Maybe ':grep' is not in your interest. But it could make something more
convenient cause we can get the result in Quickfix list.
Here is the code. Tested only on Windows platform and vim version is
currently 7.3.875.
function! Grep(pattern)
exe 'grep ' . a:pattern
let @/ = substitute(a:pattern, '/\(.*\)/.*$', '\1', '')
copen
endfunction
command! -nargs=+ Grep call Grep(<q-args>) | set hls
cnoreabbrev grep
Grep<Space>//<Space>%<C-Left><C-Left><Right><C-r>=Eatchar('\s')<CR>
for Eatchar(), :helpgrep Eatchar
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.