-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·350 lines (299 loc) · 9.71 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
" Vundle
set nocompatible
call plug#begin('~/.vim/plugged')
" Misc Plugs
" Plug 'ctrlpvim/ctrlp.vim'
Plug 'mhinz/vim-startify'
Plug 'rking/ag.vim'
" Plug 'Shougo/vimproc.vim'
" Plug 'airblade/vim-gitgutter'
" Plug 'scrooloose/nerdtree'
" Plug 'terryma/vim-multiple-cursors'
Plug 'Raimondi/delimitMate.vim' " Insert mode auto-completion for quotes, parens, brackets, etc.
Plug 'scrooloose/nerdcommenter'
Plug 'tpope/vim-surround'
" Plug 'ap/vim-css-color'
" Plug 'terryma/vim-expand-region' " use +/_ to expand/contract visual selection region
" Plug 'michaeljsmith/vim-indent-object'
" Plug 'pbrisbin/vim-mkdir' " Automatically create any non-existent directories before writing the buffer.
Plug 'vim-airline/vim-airline'
" Plug 'w0rp/ale'
" Syntax Plugs
" Plug 'tpope/vim-rails'
" Plug 'vim-ruby/vim-ruby'
" Plug 'tpope/vim-cucumber'
Plug 'tpope/vim-endwise'
" Plug 'godlygeek/tabular' " Needed for vim-markdown
" Plug 'plasticboy/vim-markdown'
" Plug 'kchmck/vim-coffee-script'
" Plug 'cakebaker/scss-syntax.vim'
" Plug 'StanAngeloff/php.vim'
" Plug 'jelera/vim-javascript-syntax'
" Plug 'othree/javascript-libraries-syntax.vim'
" Plug 'myhere/vim-nodejs-complete'
" Plug 'tpope/vim-git'
" Plug 'posva/vim-vue'
" Color Schemes
Plug 'rakr/vim-one'
" Git Plugs
" Plug 'tpope/vim-fugitive'
" Disabled Plugs
"Plug 'SyntaxComplete'
"Plug 'jwkicklighter/vim-schemes'
"Plug 'nginx.vim'
"Plug 'jistr/vim-nerdtree-tabs'
"Plug 'scrooloose/syntastic'
"Plug 'Xuyuanp/nerdtree-git-plugin'
"Plug 'vim-airline/vim-airline-themes'
"Plug 'junegunn/fzf.vim'
"Plug 'justinmk/vim-sneak'
"Plug 'Yggdroot/indentLine' " Indent guides
"Plug 'pangloss/vim-javascript'
"Plug 'MarcWeber/vim-addon-mw-utils'
"Plug 'tomtom/tlib_vim'
"Plug 'tyru/open-browser.vim'
"Plug 'reedes/vim-wordy'
"Plug 'ervandew/supertab.git'
"Plug 'flazz/vim-colorschemes'
"Plug 'nanotech/jellybeans.vim'
"Plug 'zenorocha/dracula-theme', {'rtp': 'vim/'}
"Plug 'antlypls/vim-colors-codeschool'
"Plug 'wellsjo/wellsokai.vim'
"Plug 'junegunn/limelight.vim'
"Plug 'xoria256.vim'
"Plug 'whatyouhide/vim-gotham'
"Plug 'zeis/vim-kolor'
"Plug 'elzr/vim-json'
"Plug 'dag/vim2hs'
"Plug 'eagletmt/ghcmod-vim'
"Plug 'ahw/vim-hooks'
"Plug 'majutsushi/tagbar'
"Plug 'shawncplus/phpcomplete.vim'
"Plug 'Lokaltog/vim-powerline'
"Plug 'myusuf3/numbers.vim'
call plug#end()
filetype plugin indent on
" Don't store swapfiles in the project directory
"set backupdir=$TEMP//
"set directory=$TEMP//
" Airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='one'
" AutoCMD stuff
autocmd BufWritePost *.hs GhcModCheckAndLintAsync
autocmd FileType ruby compiler ruby
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
" Detect platform for keybindings
if has("unix")
let s:uname = system("uname -s")
if s:uname == "Darwin\n"
let s:keyplatform = "mac"
else
let s:keyplatform = "linux"
endif
else
let s:keyplatform = "windows"
endif
"if has("autocmd") && exists("+omnifunc")
"autocmd Filetype *
"\ if &omnifunc == "" |
"\ setlocal omnifunc=syntaxcomplete#Complete |
"\ endif
"endif
"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
let g:one_allow_italics=1
" CUSTOM SETTINGS
"color fox.dark
color one
set background=dark
syntax on
set number " Enable line numbers
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
set smartindent
set gfn=LigaHack:h14
set linespace=2 " Adds space in between lines
set conceallevel=0 " Do not hide any quotes
set nofoldenable " disable folding
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphs
set colorcolumn=120 " Show a line guide at 120
set autoread " Read changes to files outside vim
set magic
set showmatch " Highlight matching brackets
set incsearch
set ignorecase " Ignore case for searches by default
set smartcase
"set scrolloff=999 " Cause cursor to stay in middle of screen
"set clipboard=unnamed " Use system keyboard
set hidden " Required by ctrlspace
set splitbelow " Open new splits below the current buffer
set splitright " Open new splits to the right of the current buffer
set backspace=indent,eol,start " Fix backspace not deleting tabs, also make delimiteMate work
" CtrlSpace
"if has("gui_running")
"let g:CtrlSpaceSymbols = { "File": "◯", "CTab": "▣", "Tabs": "▢" }
"endif
"let g:CtrlSpaceSearchTiming = 0
"hi CtrlSpaceSelected term=reverse ctermfg=187 ctermbg=23 cterm=bold
"hi CtrlSpaceNormal term=NONE ctermfg=244 ctermbg=232 cterm=NONE
"hi CtrlSpaceFound ctermfg=220 ctermbg=NONE cterm=bold
" Some plugin setting
"let g:ctrlp_show_hidden=1
"let g:ctrlp_working_path_mode="rw"
let delimitMate_expand_cr = 1
"let g:UltiSnipsExpandTrigger="<tab>"
"let g:UltiSnipsJumpForwardTrigger="<c-b>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:vim_markdown_folding_disabled = 1
" Syntastic checkers
"let g:syntastic_ruby_checkers=['rubocop', 'reek']
"let g:syntastic_haml_checkers=['haml']
"let g:syntastic_scss_checkers=['scss_lint']
" Auto-focus Tagbar when opened
"let g:tagbar_autofocus = 1
" Startify Settings
let g:startify_bookmarks = [ {'v': '~/.vimrc'}, {'z': '~/.zshrc'}, {'d': '~/dev/kommander/detail-kommander'} ]
let g:startify_change_to_vcs_root = 1
" Adds indentation guide like Sublime
let g:indentLine_char = '|'
let g:indentLine_enabled = 1
" Gist Settings
"let g:gist_detect_filetype = 1 " Detect for gists filetype automatically
"let g:gist_open_browser_after_post = 1 " Open browser after creating gist
"let g:gist_show_privates = 1 " Let :Gist -l show private gists
"let g:gist_post_private = 1 " Set gists as private by default
" NERDTree/NERDTreeTabs
"let g:nerdtree_tabs_open_on_gui_startup = 0
" CUSTOM KEYBINDINGS
" Use <Space> to open prompt
nnoremap <Space> :
vnoremap <Space> :
let mapleader = ","
let maplocalleader = ","
" FZF things
"nmap ; :Buffers<CR>
"nmap <Leader>r :Tags<CR>
"nmap <Leader>t :Files<CR>
"nmap <Leader>a :Ag<CR>
"imap jk <Esc>
noremap - ^
noremap _ $
nnoremap , "+
vnoremap , "+
nnoremap Q @q
" Use Ctrl+[ to preview tag
"map <C-}> <C-W>}
" Use Ctrl+<key> shortcuts for buffers
"nmap <C-S-tab> :bprev<cr>
"nmap <C-tab> :bnext<cr>
"nmap <C-q> :bdelete<cr>
"vmap <C-S-tab> :bprev<cr>
"vmap <C-tab> :bnext<cr>
"nmap <C-q> :bdelete<cr>
"imap <C-S-tab> <C-o>:bprev<cr>
"imap <C-tab> <C-o>:bnext<cr>
"nmap <C-q> :bdelete<cr>
" Close current buffer without killing split
"command Q bp|bw#
" Close last buffer (:q last)
"command QL bw#
" Bettor split navigation
noremap <C-j> <C-W>j
noremap <C-k> <C-W>k
noremap <C-h> <C-W>h
noremap <C-l> <C-W>l
" Open CtrlSpace with CMD+Shift+A
"if s:keyplatform == "mac"
"map <D-A> :CtrlSpace<cr>
"else
"map <C-A> :CtrlSpace<cr>
"endif
" Rebuild tags with \b
"nnoremap <Leader>b :execute '!ctags -R'<cr>
" Open Syntastic error window
"nnoremap <Leader>e :Errors<cr>
"imap <C-Space> <C-x><C-o>
" Platform-specific keybindings
if (s:keyplatform == "mac" && has("gui_running"))
" Open NERDTree with CMD+\
"map <D-\> :NERDTreeToggle<cr>
" Duplicate line with CMD+D, like IntelliJ
"map <D-d> :t.<cr>
"CMD+SHIFT+F for find in project
nmap <D-F> :Ag
vmap <D-F> :Ag
imap <D-F> <esc>:Ag
" Open CtrlP with CMD+Shift+O, like IntelliJ
"map <D-O> <C-p>
"nmap <D-C> :CtrlPClearCache<cr>
" CMD+/ to toggle line comments
" Requires nerdcommenter plugin
"map <D-/> ,c<Space>
else
" Open NERDTree with CTRL+\
"map <C-\> :NERDTreeToggle<cr>
" Duplicate line with CTRL+D, like IntelliJ
"map <C-d> :t.<cr>
"CTRL+SHIFT+F for find in project
nmap <C-F> :Ag
vmap <C-F> :Ag
imap <C-F> <esc>:Ag
" Open CtrlP with CTRL+Shift+O, like IntelliJ
"map <C-O> <C-p>
"nmap <C-C> :CtrlPClearCache<cr>
" CTRL+/ to toggle line comments
" Requires nerdcommenter plugin
"map <C-/> ,c<Space>
endif
" CMD+k/CMD+j to move lines up/down
"if s:keyplatform == "mac"
"nnoremap <D-J> :m .+1<CR>==
"nnoremap <D-K> :m .-2<CR>==
"inoremap <D-J> <Esc>:m .+1<CR>==gi
"inoremap <D-K> <Esc>:m .-2<CR>==gi
"vnoremap <D-J> :m '>+1<CR>gv=gv
"vnoremap <D-K> :m '<-2<CR>gv=gv
"else
"nnoremap <C-J> :m .+1<CR>==
"nnoremap <C-K> :m .-2<CR>==
"inoremap <C-J> <Esc>:m .+1<CR>==gi
"inoremap <C-K> <Esc>:m .-2<CR>==gi
"vnoremap <C-J> :m '>+1<CR>gv=gv
"vnoremap <C-K> :m '<-2<CR>gv=gv
"endif
" CMD+e to expand emmet snippet
" Requires emmet plugin
"if s:keyplatform == "mac"
"imap <D-E> <C-y>,
"else
"imap <C-E> <C-y>,
"endif
" \zz to toggle keeping cursor in middle of screen
:nnoremap <Leader>zz :let &scrolloff=999-&scrolloff<CR>
augroup WrapLineInTxtFile
autocmd!
autocmd FileType txt setlocal wrap
autocmd FileType txt setlocal linebreak
augroup END