Update vimrc
This commit is contained in:
51
vimrc
51
vimrc
@@ -1,23 +1,40 @@
|
|||||||
syntax on
|
|
||||||
set background=dark
|
|
||||||
set laststatus=2
|
|
||||||
set t_Co=256
|
|
||||||
set encoding=utf-8
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
set expandtab
|
|
||||||
set smarttab
|
|
||||||
set autoindent
|
|
||||||
filetype on
|
|
||||||
set number
|
set number
|
||||||
set ruler
|
set ruler
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set noswapfile
|
set noswapfile
|
||||||
|
|
||||||
autocmd FileType c setlocal shiftwidth=4 softtabstop=4 expandtab
|
" enable filetype detection:
|
||||||
|
filetype on
|
||||||
|
filetype plugin on
|
||||||
|
filetype indent on " file type based indentation
|
||||||
|
|
||||||
" copy-paste
|
" for C-like programming where comments have explicit end
|
||||||
noremap <Leader>y "*y
|
" characters, if starting a new line in the middle of a comment automatically
|
||||||
noremap <Leader>p "*p
|
" insert the comment leader characters:
|
||||||
noremap <Leader>Y "+y
|
autocmd FileType c,cpp set formatoptions+=ro
|
||||||
noremap <Leader>P "+p
|
autocmd FileType c set omnifunc=ccomplete#Complete
|
||||||
|
|
||||||
|
" fixed indentation should be OK for XML and CSS. People have fast internet
|
||||||
|
" anyway. Indentation set to 2.
|
||||||
|
autocmd FileType html,xhtml,css,xml,xslt set shiftwidth=2 softtabstop=2
|
||||||
|
|
||||||
|
" two space indentation for some files
|
||||||
|
autocmd FileType vim,lua,nginx set shiftwidth=2 softtabstop=2
|
||||||
|
|
||||||
|
" for CSS, also have things in braces indented:
|
||||||
|
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
|
||||||
|
|
||||||
|
" add completion for xHTML
|
||||||
|
autocmd FileType xhtml,html set omnifunc=htmlcomplete#CompleteTags
|
||||||
|
|
||||||
|
" add completion for XML
|
||||||
|
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
|
||||||
|
|
||||||
|
" in makefiles, don't expand tabs to spaces, since actual tab characters are
|
||||||
|
" needed, and have indentation at 8 chars to be sure that all indents are tabs
|
||||||
|
" (despite the mappings later):
|
||||||
|
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
|
||||||
|
|
||||||
|
" ensure normal tabs in assembly files
|
||||||
|
" and set to NASM syntax highlighting
|
||||||
|
autocmd FileType asm set noexpandtab shiftwidth=8 softtabstop=0 syntax=nasm
|
||||||
|
|||||||
Reference in New Issue
Block a user