-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
250 lines (214 loc) · 5.64 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
" Because vim
set nocompatible
" General
set encoding=utf-8
set number
set nowrap
set scrolloff=5
set colorcolumn=81
set hlsearch
set incsearch
set ignorecase
set smartcase
set autowrite
" Show tabs and lists
"set list
"set list listchars=tab:\|\ ,trail:_
"highlight SpecialKey guifg=<color> ctermfg=<color>
" Tabbing and Indents
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
" Tmux is dumb
set t_ut=
" Folding
"set foldmethod=indent
"set foldlevel=99
" Set paste mode
set pastetoggle=<F2>
" map uu to exit insert mode
" inoremap uu <ESC>
" ex mode sucks
noremap Q <Nop>
" I hate temp files
set nobackup
set nowritebackup
set noswapfile
" Rubycomplete arguments
"autocmd FileType ruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby let g:rubycomplete_buffer_loading = 1
" Go is a special case language
autocmd FileType go set noexpandtab
autocmd FileType go set tabstop=4
autocmd FileType go set shiftwidth=4
autocmd FileType go set softtabstop=4
" molokai specific settings
let g:rehash256 = 1
let g:molokai_original = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
" GoImports wins
let g:go_fmt_command = "goimports"
let g:go_fmt_autosave = 1
" CtrlP should only match on filename by default
let g:ctrlp_by_filename = 1
" YCM Has bad keys that conflict with snippets.
let g:ycm_key_list_select_completion = ['<Down>']
let g:ycm_key_list_previous_completion = ['<Up>']
set completeopt-=preview
" Gitgutter is slow
let g:gitgutter_enabled = 0
" Powerline symbols for status line, preview window makes redrawing painful
" Snippets Triggers
let g:UltiSnipsEditSplit = 'vertical'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsListSnippets = '<c-tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
" Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Searches stuff
Plugin 'mileszs/ack.vim'
" Makes a an argument text object
"Plugin 'vim-scripts/argtextobj.vim'
" Buffer explorer
"Plugin 'vim-scripts/bufexplorer.zip'
" File/buffer/dir fuzzy searcher
Plugin 'kien/ctrlp.vim'
" Completes open and closing pairs of various surrounds
Plugin 'Raimondi/delimitMate'
" Fuzzy finding
"Plugin 'vim-scripts/FuzzyFinder'
" Makes gists from vim
"Plugin 'mattn/gist-vim'
" Adds vim things in gutter.
"Plugin 'airblade/vim-gitgutter'
" Unde Tree
Plugin 'sjl/gundo.vim'
" Indent lines
"Plugin 'Yggdroot/indentLine'
" Fuzzy finder libs
"Plugin 'vim-scripts/L9'
" Treeviews
Plugin 'scrooloose/nerdtree'
" Network read-write scp/ftp etc
"Plugin 'vim-scripts/netrw.vim'
" Tabs multiple values with regex
"Plugin 'godlygeek/tabular'
" Snippets
"Plugin 'SirVer/ultisnips'
" Snippet Pack for Ultisnips
"Plugin 'aalvarado/ultisnips-snippets'
" Aliases words and searches
Plugin 'tpope/vim-abolish'
" Powerline substitute
Plugin 'bling/vim-airline'
" Modernizes ga command
"Plugin 'tpope/vim-characterize'
" Solarized color scheme
"Plugin 'altercation/vim-colors-solarized'
" Fugitive Git helper for log viewing
"Plugin 'int3/vim-extradite'
" Git helper
"Plugin 'tpope/vim-fugitive'
" Go helpers
Plugin 'fatih/vim-go'
" Enhances %
"Plugin 'tsaleh/vim-matchit'
" Multiple cursors
"Plugin 'terryma/vim-multiple-cursors'
" For managing sessions more easily
Plugin 'tpope/vim-obsession'
" Makes p and P autoindent.
Plugin 'sickill/vim-pasta'
" Powerline
"Plugin 'Lokaltog/vim-powerline'
" For rails dev
Plugin 'tpope/vim-rails'
" For surrounding text with tags/chars
Plugin 'tpope/vim-surround'
" XP Template snippet engine
" Plugin 'drmingdrmer/xptemplate'
" Super completion
Plugin 'Valloric/YouCompleteMe'
" Vim plugin that displays tags in a window
Plugin 'majutsushi/tagbar'
" Self installed bundles
Plugin 'colorpack'
Plugin 'colorscroll'
call vundle#end()
filetype plugin indent on
" Fuzzyfinder maps
nmap ,f :FufDir<CR>
" CtrlP maps
nmap ,d :CtrlPDir<CR>
nmap ,b :CtrlPBuffer<CR>
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'rw'
set wildignore+=*/.git/*
nmap <F3> :GitGutterToggle<CR>
" nerdTree
map <C-n> :NERDTreeToggle<CR>
" autoload the tree when start vim
" autocmd vimenter * NERDTree
" tagbar
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
nmap <F8> :TagbarToggle<CR>
" Automatically open quickfix window
au QuickFixCmdPost grep cwindow 5
" Add a nice rails-friendly find in files command
command! -nargs=1 F grep -i -r --exclude-dir=log --exclude-dir=.git --exclude-dir=tmp --exclude-dir=public/assets --exclude-dir=vendor --exclude=tags <args> .
" Make a command to fold everything up.
command! -nargs=0 Fall set foldmethod=syntax | exe "normal zM" | set foldmethod=manual
" Make a keybind for Go test coverage
au FileType go nmap <leader>t <Plug>(go-coverage)
" Make awesome always-visible status line
"set statusline=%f\ %m%r%y\ d:%03b\ h:%02B\ %{fugitive#statusline()}%=%l,%c\ %P
set laststatus=2
if has("gui_running")
" GUI is running or is about to start.
" Maximize gvim window.
set lines=999 columns=999
" set guifont=Powerline\ Consolas\ 10
set guioptions-=T "Toolbar
set guioptions-=L "Something
set guioptions-=l "Left scrollbar
set guioptions-=m "Menu
set background=light
colors molokai
"let g:airline_theme = 'solarized'
let g:airline_powerline_fonts = 1
let g:Powerline_symbols = 'fancy'
else
colors molokai
endif
" Syntax and colors
syntax on
set t_Co=256
" set t_Co=8
" Dark Themes
"colors zenburn
"colors jellybeans
"colors kellys
"colors wombat256
"colors xoria256
"colors zmrok
"colors rootwater
"colors psclone
"colors darkburn
"colors slate
"colors sorcerer
"colors solarized
"colors Mustang
" Light Themes
"colors wood
"colors zenesque
"colors autumn
"colors oceanlight
"colors summerfruit256