Remove autocmd to right string white space

This commit is contained in:
Kenneth Benzie 2017-11-20 21:17:30 +00:00
parent d494a0f543
commit e049445284
3 changed files with 11 additions and 15 deletions

View File

@ -9,3 +9,12 @@ function! do#isort()
call system('isort '.expand('%:p')) call system('isort '.expand('%:p'))
edit! edit!
endfunction 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

View File

@ -1 +1,3 @@
command! ISort call do#isort() command! ISort call do#isort()
" TODO: Make RStripLines work on a range
command! RStripLines call do#rstrip_lines()

View File

@ -39,21 +39,6 @@ function! s:Synstack()
endfunction endfunction
command Synstack :call s:Synstack() 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 " Stringify
" Make a code block in to a C string literal " Make a code block in to a C string literal
function! s:Stringify() function! s:Stringify()