Ubuntu delete whitespace using vim

MacVim icon, glossy style
MacVim icon, glossy style (Photo credit: Wikipedia)


Well, I share to you to delete white space using vim. Please follow me.
1. Copy function below to ~/.vimrc

function! DelWhiteSpace()
  %s/\s\+$//e
endfunction
autocmd BufWritePre     *.rb :call DelWhiteSpace()

2. Open a file that has whitespace and write
:call DelWhiteSpace()
3. And write to save and quit
:wq


Hopefully this article is useful. :)


Enhanced by Zemanta

Komentar

Postingan populer dari blog ini

EPrT English Proficiency Test Soal - soal

cara memunculkan dan menyembunyikan icon date, time, clock, volume, network, power battery, action center pada taskbar pada Windows 7