diff --git a/autoload/do.vim b/autoload/do.vim index 0c78d93..944a67e 100644 --- a/autoload/do.vim +++ b/autoload/do.vim @@ -9,3 +9,12 @@ function! do#isort() call system('isort '.expand('%:p')) edit! endfunction + +" TODO: Make do#rstrip_lines work on a range +function! do#rstrip_lines() + let l:line = line('.') + let l:column = col('.') + execute '%s/\s\+$//e' + nohlsearch + call cursor(l:line, l:column) +endfunction diff --git a/plugin/commands.vim b/plugin/commands.vim index c1e034f..fa618e8 100644 --- a/plugin/commands.vim +++ b/plugin/commands.vim @@ -1 +1,3 @@ command! ISort call do#isort() +" TODO: Make RStripLines work on a range +command! RStripLines call do#rstrip_lines() diff --git a/plugin/functions.vim b/plugin/functions.vim index ae87d2e..5959e53 100644 --- a/plugin/functions.vim +++ b/plugin/functions.vim @@ -39,21 +39,6 @@ function! s:Synstack() endfunction command Synstack :call s:Synstack() -" Strip trailing whitespace -function! s:StripWhitespace() - let l:line = line('.') - let l:column = col('.') - execute '%s/\s\+$//e' - nohlsearch - call cursor(l:line, l:column) -endfunction -command! StripWhitespace :call s:StripWhitespace() -augroup strip_white_space - " Strip whitespace on buffer write - autocmd! - autocmd BufWritePre * :call s:StripWhitespace() -augroup END - " Stringify " Make a code block in to a C string literal function! s:Stringify()