1
0
Fork 0

removing trailing spaces on exit takes time, so we are better off without it =/

This commit is contained in:
Von Random 2015-04-20 14:01:55 +03:00
parent f216b382ee
commit 418e08aa78

21
vimrc
View file

@ -37,16 +37,17 @@ autocmd BufNewFile *.rb 0put =\"#!/usr/bin/env ruby\<nl>\"|$
autocmd BufNewFile *.py 0put =\"#!/usr/bin/env python3\<nl>\"|$ autocmd BufNewFile *.py 0put =\"#!/usr/bin/env python3\<nl>\"|$
autocmd BufNewFile *.pl 0put =\"#!/usr/bin/env perl\<nl>\use strict;\<nl>\use warnings;\<nl>\use feature 'say';\<nl>\"|$ autocmd BufNewFile *.pl 0put =\"#!/usr/bin/env perl\<nl>\use strict;\<nl>\use warnings;\<nl>\use feature 'say';\<nl>\"|$
" remove trailing spaces and tabs on exit " remove trailing spaces and tabs on exit - apparently takes a shit ton of
function! <SID>StripTrailingWhitespaces() " time to close the document, so no, let us keep it out of business for now
let l = line(".") "function! <SID>StripTrailingWhitespaces()
let c = col(".") " let l = line(".")
%s/\s\+$//e " let c = col(".")
call cursor(l, c) " %s/\s\+$//e
unlet l " call cursor(l, c)
unlet c " unlet l
endfunction " unlet c
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces() "endfunction
"autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" maps " maps
let mapleader = "," let mapleader = ","