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