-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc-linux
76 lines (69 loc) · 3.02 KB
/
vimrc-linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
" Basics {
set nocompatible " get out of horrible vi-compatible mode
set background=dark " we are using a dark background
syntax on " syntax highlighting on
" }
" General {
set history=1000 " How many lines of history to remember
set fileformats=unix,dos,mac " support all three, in this order
set mouse=a " use mouse everywhere...use shift+mouse selection to copy from Vim
" }
" Vim UI {
set showcmd " show the command being typed
set number " turn on line numbers
set backspace=2 " make backspace work normal
set noerrorbells " don't make noise
set shortmess=atI " shortens messages to avoid 'press a key' prompt
set ruler " always show current positions along the bottom
set clipboard=unnamed " allow usage of system clipboard
" }
" Visual Cues {
set showmatch " show matching brackets
set nohlsearch " do not highlight searched for phrases
set incsearch " BUT do highlight as you type your search phrase
set scrolloff=5 " Keep 5 lines (top/bottom) for scope
set novisualbell " don't blink
set laststatus=2 " always show the status line
set statusline=%f%m%r%h%w\ %y%=%c,%l/%L\ %P
" }
" Indent Related {
filetype indent on
filetype on
filetype plugin on
set nosmartindent " smartindent (filetype indenting instead)
set autoindent " autoindent (should be overwrote by cindent or filetype indent)
set cindent " do c-style indenting
set softtabstop=4 " unify
set shiftwidth=4 " unify
set tabstop=4 " real tabs should be 4, but they will show with set list on
set copyindent " but above all -- follow the conventions laid before us
" don't unindent after using a # comment. Press ctrl-v, ctrl-h to get the ^H
inoremap # X#
" }
" Text Formatting/Layout {
set formatoptions=tcq " See Help (complex)
set shiftround " when at 3 spaces, and I hit > ... go to 4, not 5
set expandtab " no real tabs please!
set preserveindent " but above all -- follow the conventions laid before us
set ignorecase " case insensitive by default
set smartcase " if there are caps, go case-sensitive
set completeopt=menu,longest,preview " improve the way autocomplete works
set wildignorecase " tab complete with case insensitivity
"set cursorline " show the current row
"set cursorcolumn " show the current column
set pastetoggle=<f12> " pastetoggle (same indentation on pastes)
set wrap " word wrap visually
set linebreak " only wrap at a character in the breakat option
" }
" Autocompletes {
autocmd FileType python set omnifunc=pythoncomplete#Complete|set expandtab|set softtabstop=4
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS|setlocal comments-=:// comments+=f://
autocmd FileType html set nocindent|set nocopyindent
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete|setlocal comments-=:// comments+=f://
autocmd FileType cpp set omnifunc=cppcomplete#Complete|setlocal comments-=:// comments+=f://
autocmd FileType make setlocal noexpandtab
" }
autocmd BufWritePre * :%s/\s\+$//e " remove trailing spaces