Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Useful vimrc settings

Sylvan Zheng edited this page Jul 1, 2014 · 1 revision

Standardizing code

set expandtab automatically expands your tabs to spaces

autocmd VimEnter *.rb :%s/\s\+$//e
autocmd VimEnter *.rb :%s/\t/  /ge
autocmd VimEnter *.rb :w

automatically strips trailing whitespace and replaces existing tabs with 2 spaces, and saves the file when opening a file