On Jun 18, 2:34 pm, g b <[email protected]> wrote:
> Is it possible to hide empty lines in vim whithout leaving anyhing in
> it's place? (unlike :fold)
>

Well...this will ALMOST do it:

set foldexpr=HideWhiteSpace()
set foldmethod=expr
function! HideWhiteSpace()
  if getline(v:lnum)=~'^\s*$'
    if getline(v:lnum+1)!~'^\s*$'
      return '<1'
    else
      return 1
    endif
  else
    if getline(v:lnum+1)=~'^\s*$'
      return '>1'
    else
      return 0
    endif
  endif
endfunction


Two caveats:
1. I haven't done more than a quick glance at a foldcolumn to test
2. If you file starts with a bunch of blank lines, it will still show
a single one at the top

Take a look at :help fold-expr to see what's going on.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to