diff --git a/.vim/functions.vim b/.vim/functions.vim new file mode 100644 index 0000000..70efefc --- /dev/null +++ b/.vim/functions.vim @@ -0,0 +1,9 @@ +function! s:unalign() range + for l:line in range(a:firstline, a:lastline) + let l:text = getline(l:line) + let l:subst = substitute(l:text, '\(\S\+\)\s\{2,}', '\1 ', 'g') + call setline(l:line, l:subst) + endfor +endfunction + +command! -range UnAlign ,call s:unalign() diff --git a/.vimrc b/.vimrc index a860aeb..34f9ef4 100644 --- a/.vimrc +++ b/.vimrc @@ -3,3 +3,4 @@ set runtimepath+=~/.vim runtime plugins.vim runtime options.vim runtime keymaps.vim +runtime functions.vim