ack.vim icon indicating copy to clipboard operation
ack.vim copied to clipboard

no highlighting when searching with regrex

Open mboughaba opened this issue 6 years ago • 4 comments

Hi,

let g:ackhighlight = 1

When searching with regex, the matching searched term is not highlighted.

Ack! "TODO|FIXME|NOTE|HACK")

This is the code which is doing the highlighting

function! s:Highlight(args) "{{{
  if !g:ackhighlight
    return
  endif

  let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
  call feedkeys(":let &hlsearch=1 \| echo \<CR>", "n")
endfunction "}}}

Have no idea how to start with that matchstr :rofl:

mboughaba avatar Oct 28 '17 21:10 mboughaba