How to print (hardcopy) with folds in Vim? -
i have simple todo list dates , tags :
141218 call school &phone @me 141219 buy groceries &buy @me 141220 have w order books &buy @w 141220 think vacation &vac @me 141221 have w try santa claus outfit &fam @w 141222 ask question s.o. &vim @me
this list not long (i have longer files in mind), suppose want print it, , print, e.g., @w part ?
first shall search :
/&w
then fold (vim wikia simple folding : tip 282)
:set foldexpr=getline(v:lnum)!~@/ :nnoremap <f8> :set foldmethod=expr<cr><bar>zm
i have :
+—- 2 lines 141220 have w order books &buy @w +—- 1 line 141221 have w try santa claus outfit &fam @w +—- 1 line
this works fine down hardcopy part : lines displayed…
how should proceed print folded file ?
unfortunately, :hardcopy
doesn't consider current representation in window, prints physical contents (and has other limitations, ignoring concealment).
use means of printing
the :tohtml
command ships vim, , can create html representation of current window, including folds. can print html file browser.
(temporarily) remove lines instead of folding
you can :global
command:
:global!/@w/delete _ :hardcopy :undo
maybe custom command:
:command! -nargs=? hardcopymatching execute 'global!/' . <q-args> . '/delete _' | hardcopy | undo
Comments
Post a Comment