From f84e0cf5c205878501013bf8368f4f41b1cc85f3 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 10 Oct 2014 09:11:18 +0400 Subject: [PATCH] VIM: tabs are replaced with spaces. --- vim/vimrc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 51e5af0..9da6dec 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -15,8 +15,10 @@ set viminfo='20,\"50 " read/write a .viminfo file, don't store more set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set tabstop=4 " make tabes to be equal to 4 space chars. +set shiftwidth=4 " for indentation shift by 4 chars. set expandtab " this is for MG files. -set shiftwidth=4 " for shifting by 4 when pressing tab. +set softtabstop=4 " insert/ deletes 4 space chars. +set smarttab " insert/ space in front of line instead of tab. set fileformat=unix " line ending is unix set textwidth=80 " 80 char text let g:netrw_preview = 1 " netrw open window to the right @@ -56,8 +58,8 @@ if exists('&hidden') set hidden endif -" Instead of failing a command because of unsaved changes, instead raise a -" dialogue asking if you wish to save changed files. +" Instead of failing a command because of unsaved changes, raise a dialogue +" asking if you wish to save changed files. if exists('&confirm') set confirm endif @@ -87,9 +89,8 @@ if exists('&modeline') set modeline set modelines=10 endif -" + " Set fold method if supported -" if has('folding') set nofoldenable set foldmethod=indent "fold based on indent @@ -102,9 +103,18 @@ if has('folding') autocmd FileType cpp setlocal foldmethod=syntax endif endif -" + +" Unset expandtab for make files in any case. +if has('autocmd') + autocmd FileType make setlocal noexpandtab +endif + +" Set expandtab for python files in any case. +if has('autocmd') + autocmd FileType python setlocal expandtab +endif + " P4 -" command! -nargs=* PFedit :!p4 edit % command! -nargs=* PFrevert :!p4 revert % command! -nargs=* PFdiff :!p4 diff %