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
|
"-----------------------------------------------------------------------------------------------------------------------
" Nerdtree Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/nerdtree/plugin/NERD_tree.vim'))
let NERDTreeShowLineNumbers=1
nnoremap <leader>n :NERDTreeTabsToggle<CR>
nnoremap <leader>m :NERDTreeFind<CR>
let NERDTreeDirArrows=0
let NERDTreeMapOpenSplit = 's'
let NERDTreeMapOpenVSplit = 'v'
let NERDTreeWinSize = 40
let NERDTreeIgnore = ['\.pyc$']
let g:NERDTreeDirArrows = 1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
endif
"-----------------------------------------------------------------------------------------------------------------------
" Emmet Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/emmet-vim/plugin/emmet.vim'))
let g:use_emmet_complete_tag = 1
endif
"-----------------------------------------------------------------------------------------------------------------------
" Indent Lines Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-indent-guides/plugin/indent_guides.vim'))
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
let g:indent_guides_exclude_filetypes =['help', 'nerdtree']
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=0
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=0
endif
"-----------------------------------------------------------------------------------------------------------------------
" Vdebug Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vdebug/plugin/vdebug.vim'))
let g:vdebug_options = {
\ "watch_window_style" : 'compact',
\ "port" : 9000,
\ "path_maps" : {
\ "/vagrant": "/Users/codyhiar/Sites",
\ "/var/www/html": "/Users/hiarc/Sites/inv/redis-api",
\ "/ask/sites/investopedia.com/web": "/Users/hiarc/Sites/inv/www",
\ },
\}
"Delete all breakpoints
:command! BR BreakpointRemove *
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
" Unite Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/unite.vim/plugin/unite.vim'))
let g:unite_enable_start_insert = 1
let g:unite_split_rule = "botright"
let g:unite_force_overwrite_statusline = 0
let g:unite_winheight = 10
let g:unite_source_history_yank_enable = 1
let g:unite_source_rec_max_cache_files=5000
let g:unite_source_rec_async_command =
\ ['ack', '-f', '--nofilter']
" Check to see if the plugin is loaded before callinging
if exists('g:loaded_unite')
call unite#custom_source('file_rec,file_rec/async,file_mru,file,buffer,grep',
\ 'ignore_pattern', join([
\ '\.git/',
\ ], '\|'))
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
endif
nnoremap <space>s :<C-u>Unite -buffer-name=buffer buffer -winheight=40<cr>
nnoremap <space>y :<C-u>Unite -buffer-name=yank history/yank -quick-match -max-multi-lines=1 -winheight=40<cr>
" Custom mappings for the unite buffer
autocmd FileType unite call s:unite_settings()
function! s:unite_settings()
" Enable navigation with control-j and control-k in insert mode
let b:SuperTabDisabled=1
imap <buffer> <C-j> <Plug>(unite_select_next_line)
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
imap <silent><buffer><expr> <C-x> unite#do_action('split')
imap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
imap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
endfunction
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
" SuperTab Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/supertab/plugin/supertab.vim'))
let g:SuperTabMappingForward = '<tab>'
let g:SuperTabMappingBackward = '<s-tab>'
let g:SuperTabLongestHighlight = 0
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
" Ultisnips
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/ultisnips/plugin/UltiSnips.vim'))
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsListSnippets="<c-s>"
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-k>"
let g:UltiSnipsJumpBackwardTrigger="<c-l>"
:command! SNIPS tabnew ~/.config/nvim/plugged/vim-snippets/snippets
endif
"-----------------------------------------------------------------------------------------------------------------------
"-----------------------------------------------------------------------------------------------------------------------
" Fugitive
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-fugitive/plugin/fugitive.vim'))
nnoremap <leader>gc :Gcommit --verbose<CR>
nnoremap <leader>gd :Gdiff<CR>
nnoremap <leader>gl :Glog<CR>
nnoremap <leader>gb :Gblame<CR>
function! ToggleGStatus()
if buflisted(bufname('.git/index'))
bd .git/index
else
Gstatus
endif
endfunction
command ToggleGStatus :call ToggleGStatus()
nnoremap <leader>gs :ToggleGStatus<CR>
" Diff commands
nnoremap <leader>du :diffupdate<CR>
nnoremap <leader>dd :diffget<CR>
nnoremap <leader>df :diffput<CR>
nnoremap - [c
nnoremap = ]c
endif
"-----------------------------------------------------------------------------------------------------------------------
" Python-Syntax
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/python-syntax/syntax/python.vim'))
let python_highlight_all = 1
endif
"-----------------------------------------------------------------------------------------------------------------------
" CtrlP Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/ctrlp.vim/plugin/ctrlp.vim'))
let g:ctrlp_working_path_mode = 'a'
let g:ctrlp_by_filename = 1
let g:ctrlp_status_func = {
\ 'main': 'CtrlP_main_status',
\ 'prog': 'CtrlP_progress_status',
\ }
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked
" a:1 a:2 a:3 a:4 a:5 a:6 a:7
fu! CtrlP_main_status(...)
let regex = a:3 ? '%#CtrlP_Violet#regex %*' : ''
let prv = '%#CtrlP_Purple# '.a:4.' %*'
let item = '%#CtrlP_IPurple# '.a:5.' %*'
let nxt = '%#CtrlP_Purple# '.a:6.' %*'
let byfname = '%#CtrlP_Violet# '.a:2.' %*'
let dir = '%#CtrlP_Purple# '.fnamemodify(getcwd(), ':~').' %*'
retu prv . item . nxt . '%#CtrlP_Violet#%=%*%<' . byfname . regex . dir
endf
fu! CtrlP_progress_status(...)
let len = '%#Function# '.a:1.' %*'
let dir = ' %=%<%#LineNr# '.getcwd().' %*'
retu len.dir
endf
hi CtrlP_Purple ctermfg=7 ctermbg=4
hi CtrlP_IPurple ctermfg=4 ctermbg=7
hi CtrlP_Violet ctermfg=4 ctermbg=8
endif
"-----------------------------------------------------------------------------------------------------------------------
" Flake8 Plugin
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-flake8/autoload/flake8.vim'))
autocmd FileType python map <buffer> <F9> :call Flake8()<CR>
let g:flake8_show_in_gutter=1
autocmd BufWritePost *.py call Flake8()
endif
"-----------------------------------------------------------------------------------------------------------------------
" Markdown
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-markdown/indent/markdown.vim'))
let g:vim_markdown_folding_disabled=1
endif
"-----------------------------------------------------------------------------------------------------------------------
" Dev-icons
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-devicons/plugin/webdevicons.vim'))
let g:webdevicons_enable_nerdtree = 1
let g:webdevicons_enable = 1
let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:DevIconsEnableFoldersOpenClose = 1
endif
"-----------------------------------------------------------------------------------------------------------------------
" Dash
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/dash.vim/plugin/dash.vim'))
nnoremap K :Dash<CR>
endif
"-----------------------------------------------------------------------------------------------------------------------
" Deoplete
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/deoplete.nvim/plugin/deoplete.vim'))
let g:deoplete#enable_at_startup = 1
endif
"-----------------------------------------------------------------------------------------------------------------------
" Neomake
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/neomake/plugin/neomake.vim'))
autocmd! BufWritePost * Neomake
let g:neomake_javascript_enabled_makers = ['eslint']
"let g:neomake_verbose = 3
"let g:neomake_open_list = 1
let g:neomake_javascript_eslint_maker = {
\ 'args': ['--no-color', '--format', 'compact', '--config', '~/.eslintrc.json'],
\ 'errorformat': '%f: line %l\, col %c\, %m'
\ }
endif
"-----------------------------------------------------------------------------------------------------------------------
" CamelCaseMotion
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/CamelCaseMotion/plugin/camelcasemotion.vim'))
map <silent> ,w <Plug>CamelCaseMotion_w
map <silent> ,e <Plug>CamelCaseMotion_e
map <silent> ,b <Plug>CamelCaseMotion_b
endif
"-----------------------------------------------------------------------------------------------------------------------
" Vim JSON
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/vim-json/indent/json.vim'))
let g:vim_json_syntax_conceal = 0
endif
"-----------------------------------------------------------------------------------------------------------------------
" Ack Searching
"-----------------------------------------------------------------------------------------------------------------------
if !empty(glob('plugged/ack.vim/plugin/ack.vim'))
nnoremap <space>/ :call AckSearch()<CR>
function! AckSearch()
call inputsave()
let term = input('Search: ')
call inputrestore()
if !empty(term)
execute "Ack '" . term . "'"
endif
endfunction
endif
|