-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.plug
256 lines (218 loc) · 7.02 KB
/
vimrc.plug
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
"======================================================
" vim-plug init
"======================================================
silent call plug#begin($VIMROOT.'/plugged')
" Code Completions
" Plug 'Shougo/deoplete.nvim'
" Plug 'roxma/nvim-yarp'
" Plug 'roxma/vim-hug-neovim-rpc'
" Plug 'Shougo/neco-syntax'
" Plug 'lvht/phpcd.vim', { 'for': 'php', 'do': 'composer install' }
Plug 'Shougo/neocomplcache'
Plug 'ervandew/supertab'
" Plug 'SirVer/ultisnips'
" Plug 'honza/vim-snippets'
" Fast navigation
Plug 'easymotion/vim-easymotion'
Plug 'vim-scripts/matchit.zip'
" Fast editing
"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' | Plug 'epilande/vim-es2015-snippets'
Plug 'godlygeek/tabular'
Plug 'Raimondi/delimitMate'
Plug 'mattn/emmet-vim'
"Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter'
"sort in visual model:gs
Plug 'christoomey/vim-sort-motion'
" IDE features
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
" Plug 'humiaozuzu/TabBar'
Plug 'majutsushi/tagbar'
Plug 'rking/ag.vim'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-fugitive'
"Plug 'w0rp/ale'
Plug 'vim-syntastic/syntastic'
" Plug 'bronson/vim-trailing-whitespace'
Plug 'moll/vim-bbye'
Plug 'vim-scripts/BufOnly.vim'
" UI
Plug 'itchyny/lightline.vim'
if !g:isgvim
Plug 'airblade/vim-gitgutter'
endif
Plug 'altercation/vim-colors-solarized'
" PHP
Plug '2072/PHP-Indenting-for-VIm', {'for': 'php'}
Plug 'stephpy/vim-php-cs-fixer', {'for': 'php'}
Plug 'alvan/vim-php-manual', {'for': 'php'}
" Web Frontend
" html syntax
Plug 'othree/html5.vim', {'for': ['html']}
" js syntax
Plug 'othree/yajs.vim', {'for': ['javascript', 'jsx', 'typescript']}
Plug 'othree/javascript-libraries-syntax.vim', {'for': ['javascript', 'jsx', 'typescript']}
" css syntax
Plug 'ap/vim-css-color', {'for': ['css', 'less', 'scss', 'vim']}
" js edit
Plug 'ternjs/tern_for_vim', {'do': 'npm install', 'for': ['javascript','html']}
" JsDoc
Plug 'heavenshell/vim-jsdoc', {'for': ['javascript', 'jsx', 'typescript']}
" golang
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'Chiel92/vim-autoformat', {'on': 'Autoformat'}
" markdown
Plug 'tpope/vim-markdown'
" nginx
Plug 'chr4/nginx.vim'
" Load local plugins
if filereadable($VIMROOT.'/vimrc.plug.local')
source $VIMROOT/vimrc.plug.local
endif
call plug#end()
"======================================================
" custom configure
"======================================================
" deoplete
" let g:deoplete#enable_at_startup = 1
" inoremap <silent><expr> <TAB>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ deoplete#mappings#manual_complete()
" function! s:check_back_space() abort "{{{
" let col = col('.') - 1
" return !col || getline('.')[col - 1] =~ '\s'
" endfunction"}}}
" neco-syntax syntax_lines may very very long
" let g:necosyntax#max_syntax_lines = 3000
" phpcd.vim
" let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {})
" let g:deoplete#ignore_sources.php = ['omni']
" NeoComplCache
if !g:isgvim
let g:acp_enableAtStartup = 0
let g:neocomplcache_enable_at_startup=1
let g:neoComplcache_disable_auto_complete=1
let g:neocomplcache_enable_smart_case=1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
set completeopt-=preview
endif
" SuperTab
let g:SuperTabDefaultCompletionType = '<C-X><C-U>'
let g:SuperTabRetainCompletionType=2
" ultisnips
" let g:UltiSnipsExpandTrigger="<c-k>"
" let g:UltiSnipsJumpForwardTrigger="<c-f>"
" let g:UltiSnipsJumpBackwardTrigger="<c-b>"
" vim-easymotion
let g:EasyMotion_leader_key = '<space>'
" tabular:text-align
nmap <leader>a= :Tabularize /=<CR>
vmap <leader>a= :Tabularize /=<CR>
nmap <leader>a: :Tabularize /:<CR>
vmap <leader>a: :Tabularize /:<CR>
nmap <leader>a" :Tabularize /"<CR>
vmap <leader>a" :Tabularize /"<CR>
" nerdcommenter
let NERDSpaceDelims=1
let NERDCompactSexyComs=1
" vim-sort-motion case insensitive
let g:sort_motion_flags = "i"
" nerdtree
nmap <F4> :NERDTreeToggle<cr>
noremap <C-e> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
inoremap <C-e> <ESC>:NERDTreeToggle<CR>:NERDTreeMirror<CR>
let NERDTreeWinSize=30
let NERDTreeChDirMode=2
let NERDTreeIgnore=['\.pyc', '\.pyo$', '\.obj$', '\.o$', '\.so$', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
let NERDTreeShowHidden=1
let NERDTreeQuitOnOpen=1
let NERDTreeWinPos = "left"
"close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | end
" tagbar
nmap <F5> :TagbarToggle<cr>
let g:tagbar_left=0
let g:tagbar_width=30
let g:tagbar_autofocus = 1
let g:tagbar_sort = 0
let g:tagbar_compact = 1
" javascript support: npm install -g git+https://github.com/ramitos/jsctags.git
let g:tagbar_type_javascript = {
\ 'ctagsbin' : 'jsctags'
\ }
" ctrlp
nnoremap <leader>m :CtrlPMRU<CR>
nnoremap <leader>b :CtrlPBuffer<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](node_modules|target|dist)|\.(git|hg|svn|rvm)$',
\ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
\ }
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_mruf_relative = 1
let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*'
" ag
nnoremap <leader>ag :Ag<space>
" vim-bbye
nnoremap <leader>qq :Bdelete<cr>
" BufOnly.vim
nnoremap <silent> <leader>qo :BufOnly<CR>
" lightline
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'relativepath', 'modified' ] ]
\ },
\ 'component_function': {'gitbranch': 'fugitive#head'},
\ 'tabline': {'left': [ [ 'tabs' ] ]}
\ }
" color solarized
let g:solarized_termtrans=1
let g:solarized_termcolors=256
let g:solarized_contrast="high"
let g:solarized_visibility="high"
silent! color solarized
" php-cs-fixer
" options: --config
let g:php_cs_fixer_config_file = $VIMROOT.'/php_cs'
let g:php_cs_fixer_php_path = "php"
let g:php_cs_fixer_dry_run = 0
let g:php_cs_fixer_verbose = 0
au BufWritePost *.php silent! :call PhpCsFixerFixFile()
" vim-markdown
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_no_default_key_mappings=1
let g:vim_markdown_frontmatter=1
let g:import_sort_auto = 1
" vim-jsdoc
let g:jsdoc_default_mapping = 0
autocmd FileType javascript,typescript nnoremap <leader><leader>d :JsDoc<CR>
" tern_for_vim
let tern_show_signature_in_pum = 1
let tern_show_argument_hints = 'on_hold'
au FileType javascript nnoremap <leader>d :TernDef<CR>
au FileType javascript setlocal omnifunc=tern#Complete
" vim-autoformat
" require:
" npm install -g eslint js-beautify
" auto save
au BufWrite *.js,*.html,*.css,*.less silent! :Autoformat
" less
let g:formatters_less = ['cssbeautify', 'prettier']
" syntastic
let g:syntastic_javascript_checkers = ['eslint']
" vim-go
" let g:go_debug = ['shell-commands']
let g:go_version_warning = 0
let g:go_imports_autosave = 1
let g:go_auto_type_info = 1
let g:go_bin_path = $GOPATH.'/bin'
" let g:go_auto_sameids = 1
au FileType go set nolist
nnoremap <leader>gr :GoRun<CR>
nnoremap <leader>gs :GoReferrers<CR>
nnoremap <leader>ge :GoCallees<CR>
nnoremap <leader>gc :GoCallers<CR>
nnoremap <leader>gi :GoImplements<CR>