2011-05-31 7 views

Répondre

4

Cela devrait fonctionner dans vim ...

:g/^\s*$/d

0
" Put the function bellow in your vimrc 
" remove extra newlines keeping the cursor position and search registers 
fun! DelBlank() 
    let [email protected]/ 
    let l = line(".") 
    let c = col(".") 
    :g/^\n\{2,}/d 
    let @/=_s 
    call cursor(l, c) 
endfun 
" the function can be called with "leader" d see :h <leader> 
map <special> <leader>d :keepjumps call DelBlank()<cr>