У меня проблемы с vim, gg = G не удаляет лишние переводы строк, я пытаюсь использовать
:%s/\(\n\)\n\+/\1/g
, но он не работает во всем файле.Любая помощь приветствуется.
Это должно работать в vim ...
vim
:g/^\s*$/d
" Put the function bellow in your vimrc " remove extra newlines keeping the cursor position and search registers fun! DelBlank() let _s=@/ 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>