Showing posts with label vim settings. Show all posts
Showing posts with label vim settings. Show all posts

Saturday, April 11, 2015

How to configure vi/vim for coding C - Indentation and file detection

How do we make vi-Vim not to use tab and use 4 spaces instead ?
How to make it  automatically indent code after curly brace blocks like Emacs does?
How to save these settings so that we never have to input them again?

I've seen other questions very often from vi/vim users.
 
Its pretty simple, add below lines to your .vimrc file under your home directory.

 filetype plugin indent on  
 set tabstop=4  
 set shiftwidth=4  
 set expandtab  

More information under :  filetype