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

Comments

Popular posts from this blog

Pengembang Perangkat Lunak Membangun Karya untuk UMKM

Kesalahan Pindah Blogspot ke Domain Pribadi Berujung Domain Blogspot Lenyap

Episode 5 - Meramu Nilai - Nilai Inti pada Produk