-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·81 lines (69 loc) · 2.51 KB
/
.vimrc
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
77
78
79
80
81
call plug#begin()
Plug 'altercation/vim-colors-solarized'
Plug 'fatih/vim-go'
Plug 'pangloss/vim-javascript'
Plug 'vim-ruby/vim-ruby'
Plug 'vim-scripts/groovy.vim'
call plug#end()
set nocompatible
" Use custom autoindent settings per language
filetype indent off
set noautoindent
" Backspace over everything in Insert mode
set backspace=2
set nobackup
set hlsearch
set number
set title
set visualbell
set background=dark
" colorscheme solarized
" Don't auto-comment
" autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
set laststatus=2
set statusline=%F%m%r%h%w\ [%{&ff}\%Y]\ [POS:%l,%v][%p%%]\ [LEN:%L]
set wildignore+=*/tmp/*,.*,public/assets/*,Gemfile.lock,pkg
map <C-O> :!p4 edit %<Esc>:set noreadonly<Esc>
" map <C-T> :set noexpandtab<Esc>:set tabstop=8<Esc>:set sw=8<Esc>
if exists('+colorcolumn')
set colorcolumn=81
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%81v.\+', -1)
endif
" Filetype specific stuff
autocmd BufNewFile,BufRead *.{c,h,cc} :call FreeBSD_Style()
autocmd BufNewFile,BufRead {Gemfile,*.ru} setfiletype ruby
autocmd BufNewFile,BufRead {Jenkinsfile,JenkinsBuildTest} setfiletype groovy
autocmd FileType css setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType html setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType groovy setlocal expandtab shiftwidth=4 tabstop=4
autocmd FileType javascript setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType json setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType scss setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType ruby setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType rc setlocal expandtab shiftwidth=2 tabstop=2
autocmd FileType yaml setlocal expandtab shiftwidth=2 tabstop=2
set tags=./tags,tags;/
nmap <F8> :TagbarToggle<CR>
" add default cscope database
if has("cscope")
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
map <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
map <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
map <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
map <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
map <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
map <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
map <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
endif