While the other answers here have all the necessary pointers ever needed, I think there is lacking a comprehensive solution IMHO.
Below is a ready-to-paste in your .vimrc
(or equivalent)
au BufReadPost quickfix :call ConcealPath()
function ConcealPath()
syntax match ConcealedPath /\v^\/[^|]*\// conceal cchar=&
setlocal conceallevel=2
setlocal concealcursor=nvic
setlocal nowrap
endfunction
function UnconcealPath()
setlocal conceallevel=0
setlocal wrap
endfunction
More than being a comprehensive answer, it is a more general solution.
You are now equipped to hide similar "long paths" without any file-edits, any where in vim (not just in a quickfix
window), using
:call ConcealPath()
and revert/unhide using
:call UnconcealPath()
NOTE-1: The use of set wrap
and set nowrap
is only for aesthetics that I liked in my usage
NOTE-2: You can also conveniently map your favourite keys to reduce typing in case you need frequently using the function calls
NOTE-3: All this works only when you notice +conceal
is present in your :version
(or vim --version
from terminal). So -conceal
will knock you off this deal. Neovim (nvim
) on the other hand, will not suffer from this issue due to its philosophy of all-possible features always-on.