-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.symlink
259 lines (219 loc) · 6.63 KB
/
vimrc.symlink
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
" PLUGINS
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/scrooloose/nerdtree.git'
Plug 'https://github.com/rbgrouleff/bclose.vim.git'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'mhinz/vim-signify'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'w0rp/ale'
Plug 'Chiel92/vim-autoformat'
" snippets start
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'honza/vim-snippets'
" snippets end
call plug#end()
" SETTINGS
set foldmethod=indent
set foldlevel=99
syntax enable
filetype plugin indent on
set number
set hlsearch
set directory=/tmp
set backupdir=/tmp
set undodir=/tmp
set signcolumn=yes
set updatetime=300
set exrc
"set encoding=UTF8
set secure
set hidden
set copyindent
set history=1000
set undolevels=1000
set wildignore+=*.swp,*.bak,*.pyc,*.class
set scrolloff=3
set autoindent
set visualbell
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set undofile
set clipboard=unnamedplus
set go+=a
set tags=./tags,tags,../tags
set switchbuf=usetab
set nofoldenable
set nowrap
set softtabstop=4
set tabstop=4
set shiftwidth=4
set noexpandtab
set smarttab
set autowrite
set completeopt=menu
set mouse=a
" COLORS
if $VBG == "light"
colorscheme default
else
colorscheme torte
endif
" hi SpellBad cterm=NONE ctermfg=grey ctermbg=blue
" highlight SpellBad cterm=NONE ctermfg=grey ctermbg=blue
" hi SpellCap word not capitalised |hl-SpellCap|
" hi SpellRare rare word |hl-SpellRare|
" hi SpellLocal wrong spelling for selected region |hl-SpellLocal|
highlight LineNr ctermfg=darkgrey ctermbg=None
" highlight LineNr ctermfg=darkgrey ctermbg=None
" highlight Normal ctermbg=none
" highlight NonText ctermbg=none
" MAPPINGS
nnoremap <M-j> <c-w>j
nnoremap <M-k> <c-w>k
nnoremap <M-l> <c-w>l
nnoremap <M-h> <c-w>h
nnoremap ,v <C-w>v
nnoremap ,h <C-w>s
nnoremap <C-h> :bprevious<CR>
nnoremap <C-l> :bn<CR>
nnoremap <C-a> :bufdo bd<CR>
noremap <C-q> :q!<CR>
inoremap <C-@> <C-x><C-o>
inoremap <C-SPACE> <C-x><C-o>
noremap <space> @q
nnoremap <silent> <C-d> :lclose<CR>:bdelete<CR>
nnoremap <silent> <C-w> :lclose<CR>:Bclose<CR>
"let g:syntastic_go_checkers = ['gometalinter']
" let g:syntastic_go_checkers = []
" let g:syntastic_go_gometalinter_args = ['--fast', '--disable=gotype', '--disable=gosec']
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_javascript_checkers=['eslint']
" let g:syntastic_javascript_eslint_exe='$(npm bin)/eslint'
"
" let g:syntastic_aggregate_errors = 1
" let g:syntastic_always_populate_loc_list = 0
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
"
" let g:syntastic_lua_checkers = ["luac", "luacheck"]
" let g:syntastic_lua_luacheck_args = "--no-unused-args"
let $FZF_DEFAULT_COMMAND = 'ag -l -g ""'
let $FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
" let g:autoformat_autoindent = 1
" let g:autoformat_retab = 1
" let g:autoformat_remove_trailing_spaces = 1
" rust
" let g:rustc_syntax_only = 1
" let g:rust_recommended_style = 0
" let g:formatdef_rustfmt = '"rustfmt"'
" let g:formatters_rust = ['rustfmt']
" au FileType rust nnoremap <C-b> :RustFmt<CR><CR>
" go
" let g:go_fmt_fail_silently = 1
" let g:go_def_mapping_enabled = 0
" let g:go_gocode_unimported_packages = 1
"let g:go_list_type = "quickfix"
" au FileType go nnoremap <C-/> :GoDeclsDir<cr>
" run :GoBuild or :GoTestCompile based on the go file
function! s:build_go_files()
let l:file = expand('%')
if l:file =~# '^\f\+_test\.go$'
call go#test#Test(0, 1)
elseif l:file =~# '^\f\+\.go$'
call go#cmd#Build(0)
endif
endfunction
" let g:go_fmt_command = "goimports"
" " let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck', 'gosec']
" let g:go_metalinter_autosave = 1
" let g:go_metalinter_deadline = "10s"
" let g:go_metalinter_command = "golangci-lint run"
" let g:go_decls_includes = "func,type"
" let g:go_auto_type_info = 1
"let g:go_auto_sameids = 1
" autocmd FileType go nmap <Plug>(go-build)
" autocmd FileType go nmap :GoCoverageToggle<CR>
" snippets
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:NERDTreeWinSize=30
let g:gitgutter_enabled = 1
" PLUGIN MAPPINGS
"
nnoremap <C-p> :Files<CR>
nnoremap <C-t> :Tags<CR>
nnoremap <C-e> :History<CR>
nnoremap <C-\> :Ag<CR>
noremap <C-q> :q!<CR>
" autocmd FileType c,cpp nnoremap <C-b> :ClangFormat<Cr>
nnoremap <Tab> :NERDTreeToggle<CR>
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='distinguished'
" Ultisnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-i>"
let g:UltiSnipsJumpBackwardTrigger="<c-o>"
" Default fzf layout
let g:fzf_layout = { 'down': '~40%' }
" Enable per-command history.
" CTRL-N and CTRL-P will be automatically bound to next-history and
" previous-history instead of down and up. If you don't like the change,
" explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.
let g:fzf_history_dir = '~/.local/share/fzf-history'
" [Tags] Command to generate tags file
let g:fzf_tags_command = 'make tags'
" [Buffers] Jump to the existing window if possible
let g:fzf_buffers_jump = 1
" ALE
"
let g:ale_completion_enabled = 1
" set omnifunc=ale#completion#OmniFunc
" let g:ale_linters = {'go': ['golangci-lint', 'golangserver']}
let g:ale_linters = { 'go': ['gobuild', 'gofmt', 'golint', 'gopls', 'govet'], 'python': ['flake8', 'mypy', 'pylint', 'pyls'] }
let g:ale_fixers = { 'go': ['goimports', 'gofmt'], 'python': ['autopep8'] }
let g:ale_fix_on_save = 1
let g:ale_go_golangci_lint_options = '--fast -D typecheck'
let g:ale_go_langserver_executable = 'gopls'
"let g:ale_go_staticcheck_lint_package = 1
" let g:ale_go_golangci_lint_executable = ''
"
let g:airline#extensions#ale#enabled = 1
" let g:ale_go_golangci_lint_options = ['--enable-all', '-D', 'lll']
" let g:ale_go_golangci_lint_package = 1
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_enter = 0
" let g:ale_lint_delay = 500
nmap gd :ALEGoToDefinition<cr>
nmap <c-]> :ALEGoToDefinition<cr>
" au FileType go nmap dg :GoDefPop<cr>
" au FileType go nmap <c-t> :GoDefPop<cr>
" au FileType go nmap :ALEFindReferences<CR>
noremap <C-b> :ALEFix<CR><CR>
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" split navigation
" ^[j^[l^[h^[k
" execute "set <A-J>=\ej"
" execute "set <A-K>=\ek"
" execute "set <A-L>=\el"
" execute "set <A-H>=\eh"
nnoremap <A-J> <C-W><C-J>
nnoremap <A-K> <C-W><C-K>
nnoremap <A-L> <C-W><C-L>
nnoremap <A-H> <C-W><C-H>