Permalink
Browse files

Rename funcion to Trim. Also add TrimRange function

  • Loading branch information...
1 parent 12a23fe commit 63e0fb1c11b95a621890880e47dd3d52a18fa38e @graudeejs committed Jul 23, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 vimrc
View
13 vimrc
@@ -96,22 +96,22 @@ function! PromptRemoveTrainingWhitespace()
if has_trailing_spaces
let choice = confirm("Remove trailing whitespace?", "&Yes\n&No")
if choice == 1
- call RemoveTrainingWhitespace()
+ call Trim()
let b:remove_trailing_whitespace = 1
else
let b:remove_trailing_whitespace = 0
endif
endif
elseif b:remove_trailing_whitespace == 1
- call RemoveTrainingWhitespace()
+ call Trim()
endif
endif
endfunction
"}}}
-" RemoveTrainingWhitespace() {{{
+" Trim() {{{
-function! RemoveTrainingWhitespace()
+function! Trim()
let cur_linenr = line('.')
let cur_col = col('.')
let _s=@/
@@ -122,8 +122,13 @@ function! RemoveTrainingWhitespace()
endfunction
"}}}
+" TrimRange() {{{
+function! TrimRange() range
+ exec a:firstline.",".a:lastline."substitute /\\v\\s+$//e"
+endfunction
+" }}}
" ProgrPath(prog_list) {{{
function! ProgrPath(prog_list)

0 comments on commit 63e0fb1

Please sign in to comment.