-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
197 lines (162 loc) · 5.63 KB
/
Copy pathinit.vim
File metadata and controls
197 lines (162 loc) · 5.63 KB
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
set nocompatible
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PLUGGIN MANAGER
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.config/nvim/plugged')
" LOOK AND FEEL
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'itchyny/lightline.vim'
Plug 'joshdick/onedark.vim'
" UTILITIES
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'scrooloose/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-fugitive'
Plug 'embear/vim-localvimrc'
Plug 'ervandew/supertab'
Plug 'raimondi/delimitmate'
Plug 'sbdchd/neoformat'
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
Plug 'skywind3000/asyncrun.vim'
Plug 'sheerun/vim-polyglot'
Plug 'jackguo380/vim-lsp-cxx-highlight'
" AUTOCOMPLETE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" LINTING
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'w0rp/ale'
" LANGUAGES
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TYPESCRIPT
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'HerringtonDarkholme/yats.vim'
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" GENERAL
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set clipboard+=unnamedplus
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" LOOK AND FEEL
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
" let g:onedark_terminal_italics=1
colorscheme onedark
set cursorline
function! CocCurrentFunction()
return get(b:, 'coc_current_function', '')
endfunction
let g:lightline = {
\ 'colorscheme': 'onedark',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'currentfunction', 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head',
\ 'cocstatus': 'coc#status',
\ 'currentfunction': 'CocCurrentFunction'
\ },
\ }
set number
set colorcolumn=100
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugin Configurations
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Localvimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:localvimrc_file_directory_only=1
let g:localvimrc_sandbox=0
let g:localvimrc_ask=0
" deoplete
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:deoplete#enable_at_startup = 1
set hidden
" ale
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ale_linters = {
\ 'java':[],
\}
let g:ale_linters_explicit = 1
" coc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
function! SetupCommandAbbrs(from, to)
exec 'cnoreabbrev <expr> '.a:from
\ .' ((getcmdtype() ==# ":" && getcmdline() ==# "'.a:from.'")'
\ .'? ("'.a:to.'") : ("'.a:from.'"))'
endfunction
call SetupCommandAbbrs('C', 'CocConfig')
" Neoformat
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup format
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup END
" asyncrun
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:asyncrun_open=8
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Key Mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Quick Save
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
" Nerdtree
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeWinSize=70
" Tab Navigation
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap <C-h> :tabp<CR>
nnoremap <C-l> :tabn<CR>
" CtrlP
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ctrlp_map = '<c-p>'
" Neosnippet
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
imap <C-l> <Plug>(neosnippet_expand_or_jump)
smap <C-l> <Plug>(neosnippet_expand_or_jump)
xmap <C-l> <Plug>(neosnippet_expand_target)
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
if has('conceal')
set conceallevel=2
set concealcursor=niv
endif
let g:neosnippet#enable_completed_snippet = 1
" coc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <silent> <C-]> <Plug>(coc-definition)
nmap <silent> <F12> <Plug>(coc-references)
nmap <C-k><C-r> <Plug>(coc-rename)
nmap <silent> <C-k><C-i> :call <SID>show_documentation()<CR>
nmap [a <Plug>(coc-diagnostic-prev)
nmap ]a <Plug>(coc-diagnostic-prev)
nmap <C-k><C-h> <Plug>(coc-diagnostic-info)
nmap <C-k><C-f> <Plug>(coc-fix-current)
nmap <C-k>F <Plug>(coc-fix)
inoremap <silent><expr> <c-space> coc#refresh()
" asyncrun "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
noremap <F9> :call asyncrun#quickfix_toggle(30)<cr>
" C++ comment out word
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap gcw ysw/lysw*