-
Notifications
You must be signed in to change notification settings - Fork 5
/
.vimrc
153 lines (127 loc) · 4.4 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
" -------------------------
" VIM template by @danema
" -------------------------
" User interface
set background=dark
let g:solarized_termcolors=256
let g:solarized_termtrans = 0
set guifont=Menlo\ Regular:h20
" Window navigation
map <Esc>[1;3A :wincmd k<CR>
map <Esc>[1;3B :wincmd j<CR>
map <Esc>[1;3D :wincmd h<CR>
map <Esc>[1;3C :wincmd l<CR>
" NERDTree
let g:NERDTreeMapOpenInTab='<Enter>'
let NERDTreeShowHidden=1
map <C-n> :NERDTreeTabsToggle<CR>
autocmd BufWritePost * call NERDTreeFocus() | call g:NERDTree.ForCurrentTab().getRoot().refresh() | call g:NERDTree.ForCurrentTab().render() | wincmd w
" Support Mouse-scroll & Better File navigation
set mouse=nicr
set nocompatible
set whichwrap+=<,>,[,]
set backspace=indent,eol,start
" Syntax highlighting & indentation
syntax enable
filetype plugin indent on
set expandtab
set tabstop=2 shiftwidth=2 softtabstop=2
set autoindent
" Linenumbers
set number
set updatetime=250
" Silver Searcher
if executable('ag')
" Use Ag over Grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag -Q -l --nocolor --hidden -g "" %s'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
if !exists(":Ag")
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
endif
endif
" Code completion
let g:EclimCompletionMethod = 'omnifunc'
"autocmd FileType ruby,eruby let g:EclimCompletionMethod = 'omnifunc'
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType java setlocal omnifunc=javacomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_include_object = 1
autocmd FileType ruby,eruby let g:rubycomplete_include_objectspace = 1
let g:ycm_seed_identifiers_with_syntax = 1
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_enable_balloons = 1
autocmd BufWritePost * :SyntasticCheck
" Solarized
if (&t_Co == 256 || &t_Co == 88) && !has('gui_running') &&
\ filereadable(expand("$HOME/.vim/plugin/guicolorscheme.vim"))
" Use the guicolorscheme plugin to makes 256-color or 88-color
" terminal use GUI colors rather than cterm colors.
runtime! plugin/guicolorscheme.vim
GuiColorScheme solarized
else
" For 8-color 16-color terminals or for gvim, just use the
" regular :colorscheme command.
colorscheme solarized
endif
" On save auto-create the enclosing folder if it doesn't already exist
augroup vimrc-auto-mkdir
autocmd!
autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
function! s:auto_mkdir(dir, force)
if !isdirectory(a:dir)
\ && (a:force
\ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$')
call mkdir(iconv(a:dir, &encoding, &termencoding), 'p')
endif
endfunction
augroup END
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Colorscheme
Plugin 'altercation/vim-colors-solarized'
Plugin 'guicolorscheme.vim'
Plugin 'godlygeek/csapprox'
" NERDTree
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
" Navigation
Plugin 'wincent/command-t'
Plugin 'ctrlp.vim'
Plugin 'trotter/autojump.vim'
" Programming support
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'mattn/emmet-vim'
Plugin 'rubycomplete.vim'
Plugin 'artur-shaik/vim-javacomplete2'
Plugin 'valloric/youcompleteme'
Plugin 'ervandew/eclim'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'scrooloose/syntastic'
Plugin 'mmozuras/vim-whitespace'
" In-Vim Shell
Plugin 'Conque-Shell'
Plugin 'shougo/vimshell.vim'
Plugin 'shougo/vimproc.vim'
" Script Library
Plugin 'L9'
Plugin 'Improved-AnsiEsc'
call vundle#end()