-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
283 lines (233 loc) · 6.73 KB
/
.vimrc
File metadata and controls
283 lines (233 loc) · 6.73 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
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
" see v9.1.1703 and runtime/plugin/colorresp.vim
let g:loaded_colorresp = 1
set nocompatible
set termguicolors
if executable('lumos')
" https://github.com/dargor/lumos
silent let g:terminal_background = trim(system('lumos'))
else
let g:terminal_background = 'unknown'
endif
try
if g:terminal_background ==# 'light'
colorscheme catppuccin_latte
let g:dargor_full_moumoute = 1
elseif g:terminal_background ==# 'dark'
colorscheme catppuccin_frappe
let g:dargor_full_moumoute = 1
else
colorscheme zellner
let g:dargor_full_moumoute = 0
endif
catch
colorscheme zellner
let g:dargor_full_moumoute = 0
endtry
if &diff
let g:dargor_full_moumoute = 0
endif
set autoindent
set backspace=indent,start,eol
set diffopt=filler,iwhiteall
set display=lastline,uhex
set errorbells
set expandtab
set foldenable
set foldlevelstart=99
set foldmethod=indent
set formatoptions=croqj
set ignorecase
set incsearch
set infercase
set mouse=
set noequalalways
set nofsync
set nojoinspaces
set regexpengine=2
set report=0
set ruler
set scrolloff=5
set shiftround
set shiftwidth=4
set showcmd
set smartcase
set smarttab
set tabpagemax=99
set textwidth=79
set title
set ttyfast
set updatetime=100
set viminfo=
set virtualedit=block
set wildmenu
set wildmode=list:longest,full
if exists('&swapsync')
set swapsync=
endif
set nomodeline
set secure
set encoding=utf8
set t_BE=
if g:dargor_full_moumoute
if &columns >= 86
set number
set signcolumn=yes
endif
endif
let g:netrw_dirhistmax = 0
let g:rainbow_active = 1
let g:rainbow_conf = {}
let g:rainbow_conf.ctermfgs = ['blue', 'yellow', 'green', 'magenta']
let g:python_highlight_all = 1
let g:python_highlight_file_headers_as_comments = 1
let g:gitgutter_diff_args = '-w'
let g:gitgutter_map_keys = 0
let g:gitgutter_max_signs = -1
let g:gitgutter_sign_allow_clobber = 1
let g:vim_ai_chat_markdown = 1
let g:llama_config = #{
\ endpoint: 'http://localhost:1336/infill',
\ max_line_suffix: 80,
\ show_info: v:false,
\ }
if &t_Co > 2
syntax on
set hlsearch
function! SetupHighlights()
" :h highlight-groups
" :so $VIMRUNTIME/syntax/hitest.vim
highlight WhiteSpaces ctermbg=Red
highlight clear LspHintText
highlight link LspHintText NonText
highlight clear LspHintVirtualText
highlight link LspHintVirtualText NonText
highlight clear LspInformationText
highlight link LspInformationText NonText
highlight clear LspInformationVirtualText
highlight link LspInformationVirtualText NonText
highlight clear LspWarningText
highlight link LspWarningText WarningMsg
highlight clear LspWarningVirtualText
highlight link LspWarningVirtualText WarningMsg
highlight clear LspErrorText
highlight link LspErrorText Error
highlight clear LspErrorVirtualText
highlight link LspErrorVirtualText Error
highlight clear LspHintHighlight
highlight link LspHintHighlight NonText
highlight clear LspInformationHighlight
highlight link LspInformationHighlight NonText
highlight clear LspWarningHighlight
highlight link LspWarningHighlight WarningMsg
highlight clear LspErrorHighlight
highlight link LspErrorHighlight Error
highlight clear lspInlayHintsType
highlight link lspInlayHintsType NonText
highlight clear lspInlayHintsParameter
highlight link lspInlayHintsParameter NonText
if index(['man', 'aichat'], &filetype) >= 0
setlocal nonumber
setlocal signcolumn=no
highlight clear WhiteSpaces
endif
endfunction
autocmd ColorScheme,Syntax * call SetupHighlights()
function! InitBuffer()
if !exists('w:WhiteSpaces')
if !hlexists('WhiteSpaces')
call SetupHighlights()
endif
let w:WhiteSpaces=matchadd('WhiteSpaces', '\(\t\|\s\+$\)')
endif
endfunction
function! EnterBuffer()
call InitBuffer()
if g:dargor_full_moumoute
setlocal cursorline
endif
endfunction
function! LeaveBuffer()
if g:dargor_full_moumoute
setlocal nocursorline
endif
endfunction
autocmd BufWinEnter * call InitBuffer()
autocmd BufEnter,WinEnter * call EnterBuffer()
autocmd BufLeave,WinLeave * call LeaveBuffer()
endif
function! MaximizeToggle()
if exists('s:maximize_session')
silent! execute 'source ' . s:maximize_session
call delete(s:maximize_session)
unlet s:maximize_session
let &hidden=s:maximize_hidden_save
unlet s:maximize_hidden_save
else
let s:maximize_hidden_save = &hidden
let s:maximize_session = tempname()
setlocal hidden
execute 'mksession! ' . s:maximize_session
only
endif
endfunction
function! ToggleMouse()
if empty(&mouse)
set mouse=a
echo ' mouse'
else
set mouse=
echo 'nomouse'
endif
endfunction
function! WFlake()
execute 'term ++kill=term wflake8 ' . expand('%:p')
resize 11
wincmd p
endfunction
function! WShell()
execute 'term ++kill=term wshellcheck ' . expand('%:p')
resize 11
wincmd p
endfunction
function! WYaml()
execute 'term ++kill=term wyamllint ' . expand('%:p')
resize 11
wincmd p
endfunction
nnoremap <space> za
nnoremap zC :setlocal foldlevel=0<CR>
nnoremap zO :setlocal foldlevel=99<CR>
nnoremap SE :setlocal spell spelllang=en<CR>
nnoremap SF :setlocal spell spelllang=fr<CR>
nnoremap SB :setlocal spell spelllang=en,fr<CR>
nnoremap SN :setlocal nospell<CR>
nnoremap WF :call WFlake()<CR>
nnoremap WS :call WShell()<CR>
nnoremap WY :call WYaml()<CR>
nnoremap fj :%!jq .<CR>
nnoremap fJ :%!jq -S .<CR>
nnoremap <F5> :syntax sync fromstart<CR>
nnoremap <F6> :set invpaste paste?<CR>
nnoremap <F7> :call ToggleMouse()<CR>
nnoremap <F8> :Lexplore<CR>
nnoremap <F9> :!%:p<CR>
nnoremap <C-W>o :call MaximizeToggle()<CR>
nnoremap <C-W>O :call MaximizeToggle()<CR>
nnoremap <C-W><C-O> :call MaximizeToggle()<CR>
filetype plugin indent on
autocmd FileType rust setlocal matchpairs+=<:> | syntax keyword Keyword async await
autocmd FileType ruby,eruby,xml,yaml,json,markdown setlocal shiftwidth=2 softtabstop=2
autocmd FileType make setlocal noexpandtab shiftwidth=8
autocmd FileType markdown setlocal formatoptions-=tc
autocmd FileType gitcommit setlocal nowrap
if g:dargor_full_moumoute
autocmd FileType cmake RainbowToggleOff
endif
cnoreabbrev t terminal
cnoreabbrev vt vertical terminal
autocmd TerminalOpen * setlocal nonumber signcolumn=no
for f in split(expand('~/.vim*.vim'), '\n')
if filereadable(f)
execute 'source ' . f
endif
endfor