3 " autocmd! BufWritePost,BufEnter * Neomake
6 hi Comment ctermfg=black ctermbg=NONE cterm=bold
7 "hi Comment ctermfg=darkgray cterm=bold
8 hi Conceal ctermfg=black ctermbg=NONE cterm=bold
9 hi CursorLine cterm=none guibg=NONE
10 hi CursorLineNr ctermfg=white cterm=NONE
11 hi FoldColumn ctermfg=black ctermbg=none cterm=bold
12 hi Folded ctermfg=black ctermbg=NONE cterm=bold
13 hi LineNr ctermfg=black ctermbg=none cterm=bold
14 hi Pmenu ctermbg=magenta ctermfg=black
15 hi PmenuSel ctermbg=darkmagenta ctermfg=black
16 hi PmenuSbar ctermfg=gray ctermbg=black
17 hi PmenuThumb ctermfg=white
18 hi Search ctermfg=black ctermbg=yellow
19 hi SignColumn ctermbg=black
20 hi SpecialKey ctermfg=black cterm=bold
21 hi StatusLine term=bold,reverse ctermfg=white ctermbg=blue cterm=none
22 hi StatusLineNC term=reverse ctermfg=blue ctermbg=none cterm=underline
23 hi Visual ctermfg=black ctermbg=yellow cterm=none
24 hi WarningMsg ctermbg=darkyellow ctermfg=white
25 au FileType xml hi xmlAttrib ctermfg=green
26 au FileType xslt hi xmlNamespace ctermfg=red
27 au FileType xslt hi xmlAttrib ctermfg=green
28 au FileType * hi Special ctermfg=red
29 "au FileType haskell hi Comment ctermfg=DarkGreen
30 au FileType haskell hi Identifier ctermfg=LightGray
32 " Search term under cursor
33 nmap <silent> * :set hls<CR>:let @/="\\<<C-r><C-w>\\>"<CR>/<BS>
34 nmap <silent> <C-n> :set hls<CR>:call Vimgrepbuffers('\<' . expand('<cword>') . '\>')<CR>
35 " Search subterm under cursor
36 nmap <silent> µ :set hls<CR>:let @/="<C-r><C-w>"<CR>/<BS>
37 nmap <silent> <C-m> :set hls<CR>:call Vimgrepbuffers(expand('<cword>'))<CR>
39 fun! Vimgrepbuffers(pattern)
40 exe 'vimgrep /' . a:pattern . '/g ' . getbufinfo({'buflisted': 1})->map({_,b -> fnameescape(b.name)})->join(' ')
44 " If focus changed, restore it (jump to the last window).
45 if l:winnr isnot# winnr()
49 command! -nargs=1 G set hls | call Vimgrepbuffers(<f-args>)
66 " Maintain Visual Mode after shifting > and <
71 vmap I :m '<-2<CR>gv=gv
72 vmap K :m '>+1<CR>gv=gv
75 " Fix <Home>, <End>, <C-Left>, etc. when vim is in tmux;
76 " tmux will send xterm-style keys when xterm-keys is on
77 execute "set <xHome>=\e[7~"
78 execute "set <xEnd>=\e[8~"
79 execute "set <xRight>=\e[1;*C"
80 execute "set <xLeft>=\e[1;*D"
81 execute "set <xUp>=\e[1;*A"
82 execute "set <xDown>=\e[1;*B"
90 set completeopt=menu,menuone,popup,longest
93 set cpoptions+=M " ignore backslashes in % matching
95 silent !mkdir -p ~/.cache/vim/swap
96 set directory=$HOME/.cache/vim/swap
98 set diffopt=internal,filler,closeoff,algorithm:histogram,indent-heuristic
104 function! GetFoldExprFromIndent()
105 " Calcule l'indentation en fonction des tabulations
106 " et espaces au début des lignes
107 let line = getline(v:lnum)
108 let tabs = matchend(line,"^\t*")
109 let spaces = matchend(line,"^[ \t]*") - tabs
110 return tabs + ((spaces + 3) / 4)
112 set foldexpr=GetFoldExprFromIndent()
114 set foldlevelstart=99
115 set foldmethod=indent
125 set path=.,/usr/include,/usr/local/include,,
135 set maxmempattern=2000
145 "set runtimepath=$HOME/.vim,$VIMRUNTIME,$VIM
146 set sessionoptions=curdir,folds
150 "set statusline+=\ %l:%c
151 "set statusline=\ %{get(b:,'coc_current_function','')}
153 "set statusline+=%#ErrorMsg#%{CocStatusDiagnosticError()}%*
154 "set statusline+=\ %{CocStatus()}
155 set statusline+=%{LinterStatus()}
156 set statusline+=\ %m%R\ %Y
162 silent !mkdir -p ~/.cache/vim/view
163 set viewdir=$HOME/.cache/vim/view
164 set viminfo+=n$HOME/.cache/vim/info
167 set whichwrap+=<,>,[,]
168 set wildignore=*.a,*.d,*.o,*.so,*~,*.cmo,*.cmi,*.cmx,*.cmxs,*.cma,*.cmxa,*.byte,*.native,*.hi
170 set wildmode=list:longest,full
173 " When editing a file, always jump to the last known cursor position.
174 " Don't do it when the position is invalid or when inside an event handler
175 " (happens when dropping a file on gvim).
176 autocmd BufReadPost *
177 \ if line("'\"") > 0 && line("'\"") <= line("$") |
178 \ exe "normal g`\"" |
181 if (&term == "screen" || &term == "screen.linux")
185 if has("gui_running")
188 set titlestring=VIM:\ %F\ %a%r%m
199 "set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}
200 auto BufEnter * :set title | let &titlestring = 'VIM: ' . expand('%:p')
201 "auto VimLeave * :set t_ts=
\ek
\e\
203 let space = &shiftwidth == 0 ? &tabstop : &shiftwidth
204 if (&term == "linux" || &term == "screen.linux")
205 "set foldtext=substitute(getline(v\:foldstart),'^\\(\\s*\\)',{m->substitute(m[1],'\\('.repeat('\ ',&shiftwidth).'\\\|\\t\\)','\|'.repeat('.',&shiftwidth-1),'g')},'').'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
206 "set fillchars=fold:_
207 set list listchars=nbsp:+,tab:\|.,trail:_,extends:>,precedes:<
208 set foldtext=getline(v\:foldstart).'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
210 "set foldtext=substitute(getline(v\:foldstart),'^\\(\\s*\\)',{m->substitute(m[1],'\\('.repeat('\ ',&shiftwidth).'\\\|\\t\\)','⎢'.repeat('·',&shiftwidth-1),'g')},'').'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
211 "set fillchars=fold:·
212 set foldtext=getline(v\:foldstart).'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
213 set list listchars=nbsp:¬,tab:⎢·,trail:·,extends:>,precedes:<
216 "let g:indentLine_char_list = ['⎢']
217 "" Concealed text is not highlighted by the visual mode, this is annoying.
218 ""let g:indentLine_concealcursor = 'incv'
219 "let g:indentLine_faster = 1
220 "let g:indentLine_first_char = '⎢'
221 "let g:indentLine_leadingSpaceChar = '·'
222 "let g:indentLine_leadingSpaceEnabled = 1
223 "let g:indentLine_showFirstIndentLevel = 1
224 "let g:indentLine_bgcolor_term = 'NONE'
225 "let g:indentLine_defaultGroup = 'Folded'
227 if (v:version >= 700)
228 hi TabLine term=bold,reverse ctermfg=white ctermbg=blue cterm=none
229 hi TabLineFill term=bold,reverse ctermfg=none ctermbg=blue cterm=none
230 hi TabLineSel term=reverse ctermfg=white ctermbg=none cterm=bold
231 imap <C-S-tab> <Esc>:tabprevious<CR>i
232 imap <C-t> <Esc>:tabnew<CR>
233 imap <C-tab> <Esc>:tabnext<CR>i
234 nmap <C-S-tab> :tabprevious<CR>
235 nmap <Esc><tab> :bnext<CR>
236 nmap <C-t> :tabnew<CR>
237 "nmap <C-tab> :tabprevious<CR>
238 "nmap <tab> :tabnext<CR>
239 nmap <C-tab> :bprevious!<CR>
240 nmap <tab> :bnext!<CR>
241 nmap td :tabclose<CR>
242 nmap ti :tabfirst<CR>
247 nmap tn :tabnew<Space>
248 nmap tt :tabedit<Space>
249 nmap <C-i> :bprevious!<CR>
250 nmap <C-k> :bnext!<CR>
251 nmap <C-j> :lprevious<CR>
252 nmap <C-l> :lnext<CR>
253 nmap <C-u> :cprevious<CR>
254 nmap <C-o> :cnext<CR>
255 nmap <C-w>k :wincmd j<CR>
256 nmap <C-w>i :wincmd k<CR>
257 nmap <C-w>j :wincmd h<CR>
258 nmap <C-w>l :wincmd l<CR>
260 set sessionoptions+=tabpages
262 if (v:version >= 704)
263 silent !mkdir -p ~/.cache/vim/undo
264 set undodir=~/.cache/vim/undo/
266 autocmd BufWritePre /tmp/* setlocal noundofile
267 autocmd BufWritePre */sec/* setlocal noundofile
269 fun! TrimWhitespace()
270 let l:save = winsaveview()
271 keeppatterns %s/\s\+$//e
272 call winrestview(l:save)
274 autocmd BufRead .envrc setfiletype sh
275 "autocmd BufRead *.hamlet setfiletype html
276 "autocmd BufRead *.julius setfiletype javascript
277 "autocmd BufRead *.lucius setfiletype css
278 autocmd BufRead *.ledger setfiletype ledger
279 autocmd BufRead *.lhs setfiletype haskell
280 autocmd BufRead HLint.hs setfiletype txt
281 autocmd BufRead *.purs
282 \ setfiletype purescript |
284 "autocmd BufRead *.nix set syntax=zsh | set expandtab
285 autocmd BufNewFile,BufRead *.nix
286 \ hi nixAntiquotation ctermfg=cyan |
289 \ set foldmethod=indent
290 autocmd BufWritePre *.nix :call TrimWhitespace()
291 autocmd BufNewFile,BufRead *.py
295 autocmd BufNewFile,BufRead *.hs set expandtab
296 autocmd BufNewFile,BufRead *.tct set filetype=tct | set expandtab
297 autocmd BufWritePost * if &diff == 1 | diffupdate | endif
300 autocmd FileType qf setlocal wrap
302 " If doing a diff. Upon writing changes to file, automatically update the differences
307 let b:match_words = '«:»,“:”'
309 nmap <Leader>a <Plug>(EasyAlign)
310 vmap <Enter> <Plug>(EasyAlign)
311 let g:easy_align_ignore_groups = ['Comment', 'String', 'ledgerTransaction', 'ledgerTag', 'jccComment', 'jccTransaction']
313 let g:netrw_liststyle = 3
314 "let g:netrw_cursorline = 0
315 let s:netrw_usercul = 0
318 let g:buffergator_display_regime = "bufname"
319 let g:buffergator_show_full_directory_path = 0
320 let g:buffergator_viewport_split_policy = 'R'
321 let g:buffergator_autoupdate = 1
322 let g:buffergator_autodismiss_on_select = 0
323 let g:buffergator_suppress_keymaps = 1
324 nmap <leader>bq :bp <BAR> bd #<CR>
325 "let g:buffergator_mru_cycle_loop = 1
326 nmap <leader>i :BuffergatorMruCyclePrev<cr>
327 nmap <leader>k :BuffergatorMruCycleNext<cr>
328 nmap <leader>bl :BuffergatorOpen<cr>
329 nmap <leader>T :enew<cr>
330 set cpoptions+=M " ignore backslashes in % matching
332 let g:html_expand_tabs = 0
333 let g:html_ignore_conceal = 0
334 let g:html_ignore_folding = 1
335 let g:html_number_lines = 0
336 let g:html_use_xhtml = 0
338 "map <C-p> :CtrlPBuffer<CR>
339 "let g:ctrlp_working_path_mode = 'c'
340 "let g:ctrlp_map = '<Leader>t'
341 "let g:ctrlp_match_window_bottom = 0
342 "let g:ctrlp_match_window_reversed = 0
343 "let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
344 "let g:ctrlp_working_path_mode = 0
345 "let g:ctrlp_dotfiles = 0
346 "let g:ctrlp_switch_buffer = 0
349 "map <silent> tu :call GHC_BrowseAll()<CR>
350 "map <silent> tw :call GhcModType<CR>
351 map <silent> hc :GhcModTypeClear<CR>
352 map <silent> he :GhcModExpand<CR>
353 map <silent> hi :GhcModTypeInsert<CR>
354 map <silent> hs :GhcModSigCodegen<CR>
355 map <silent> hs :GhcModSplitFunCase<CR>
356 map <silent> ht :GhcModType<CR>
360 nmap <F5> :Hoogle <C-R><C-W><CR>
362 "let g:TimeKeeperUpdateFileTimeSec = 5
363 ""let g:TimeKeeperStartOnLoad = 1
364 "let g:TimeKeeperUseFlatFile = 0
365 "nmap <silent> <F8> :call TimeKeeper_ToggleTaskWindow()<cr>
366 "call TimeKeeper_StartTracking()
368 let g:RecoverPlugin_Delete_Unmodified_Swapfile = 1
370 let g:calendar_number_of_months = 1
371 let g:calendar_wruler = 'di lu ma me je ve sa'
372 let g:calendar_monday = 1
373 function MyCalAction(day,month,year,week,dir)
374 " day : day you actioned
375 " month : month you actioned
376 " year : year you actioned
377 " week : day of week (Mo=1 ... Su=7)
378 " dir : direction of calendar
380 "let calendar_action = 'MyCalAction'
381 "hi link ALEError Error
382 "hi Warning term=underline cterm=underline ctermfg=Yellow gui=undercurl guisp=Gold
383 "hi link ALEWarning Warning
384 "hi link ALEInfo SpellCap
386 "let g:echodoc#enable_at_startup = 1
387 "let g:echodoc#type = 'signature'
389 "let g:gitgutter_grep = 'rg'
390 let g:gitgutter_grep = 'grep'
391 let g:gitgutter_diff_args = '--diff-algorithm=histogram'
392 let g:gitgutter_map_keys = 0
393 let g:gitgutter_sign_added = '+'
394 let g:gitgutter_sign_modified = '±'
395 let g:gitgutter_sign_modified_removed = '-'
396 let g:gitgutter_sign_removed = '_'
397 let g:gitgutter_sign_removed_first_line = '▔'
398 let g:gitgutter_sign_priority = 9
399 hi GitGutterAdd ctermfg=green
400 hi GitGutterDelete ctermfg=red
401 hi GitGutterChange ctermfg=yellow
402 hi GitGutterChangeDelete ctermfg=red
403 nmap [c <Plug>(GitGutterPrevHunk)
404 nmap ]c <Plug>(GitGutterNextHunk)
405 nmap <Leader>p <Plug>(GitGutterPreviewHunk)
406 nmap <Leader>+ <Plug>(GitGutterStageHunk)
407 nmap <Leader>- <Plug>(GitGutterUndoHunk)
409 "let g:deoplete#enable_at_startup = 1
410 "call deoplete#custom#option('sources', {
411 "\ '_': ['ale', 'buffer', 'around'],