syntax on " Indenting via filetype on filetype indent on " Enable automaic indenting set ai " Enable smart indenting set si " Load skeletons for certain files autocmd bufnewfile *.c,*.cpp so $HOME/skeleton/c_source.txt autocmd bufnewfile *.h so $HOME/skeleton/c_header.txt autocmd bufnewfile makefile,Makefile so $HOME/skeleton/makefile.txt " Substitute and insert certain values in skeletons autocmd bufnewfile *.c,*.h,*.cpp exe "1," . 10 . "g/File Name :.*/s//File Name : " .expand("%") autocmd bufnewfile *.c,*.h,*.cpp exe "1," . 10 . "g/Creation Date :.*/s//Creation Date : " .strftime("%d-%m-%Y") autocmd bufnewfile *.c,*.h,*.cpp exe "1," . 12 . "g/Created By :.*/s//Created By : " .$USER autocmd bufnewfile *.h exe "1," . 18 . "g/#ifndef .*/s//#ifndef " . "_" .substitute(toupper(expand("%:t")),"\\.", "_","g") . "_" autocmd bufnewfile *.h exe "1," . 18 . "g/#define .*/s//#define " . "_" .substitute(toupper(expand("%:t")),"\\.", "_","g") . "_" autocmd Bufwritepre,filewritepre *.c,*.h,*.cpp execute "normal ma" autocmd Bufwritepre,filewritepre *.c,*.h,*.cpp exe "1," . 10 . "g/Last Modified :.*/s/Last Modified :.*/Last Modified : " .strftime("%c") autocmd bufwritepost,filewritepost *.c,*.h,*.cpp execute "normal `a"