VIM: tabs are replaced with spaces.

This commit is contained in:
Vahagn Khachatryan
2014-10-10 09:11:18 +04:00
parent ca1eb2d697
commit f84e0cf5c2

View File

@@ -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/<BS> deletes 4 space chars.
set smarttab " insert/<BS> 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 <args> %
command! -nargs=* PFrevert :!p4 revert <args> %
command! -nargs=* PFdiff :!p4 diff <args> %