Skip to content

Instantly share code, notes, and snippets.

@christian-marie
Last active December 31, 2015 16:49
Show Gist options
  • Save christian-marie/8016208 to your computer and use it in GitHub Desktop.
Save christian-marie/8016208 to your computer and use it in GitHub Desktop.
.vim/plugin/c.vim
fu Select_c_style()
set tabstop=8 "A tab is 8 spaces
set expandtab "Always uses spaces instead of tabs
set softtabstop=8 "Insert 4 spaces when tab is pressed
set shiftwidth=8 "An indent is 4 spaces
set smarttab "Indent instead of tab at start of line
set shiftround "Round spaces to nearest shiftwidth multiple
set foldmethod=syntax
" set nojoinspaces "Don't convert spaces to tabs
endf
au BufRead,BufNewFile *.c call Select_c_style()
au BufRead,BufNewFile *.h call Select_c_style()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment