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"
89 set completeopt=menu,menuone,popup,longest
91 set cpoptions+=M " ignore backslashes in % matching
93 silent !mkdir -p ~/.cache/vim/swap
94 set directory=$HOME/.cache/vim/swap
95 set diffopt=internal,filler,closeoff,algorithm:histogram,indent-heuristic
100 function! GetFoldExprFromIndent()
101 " Calcule l'indentation en fonction des tabulations
102 " et espaces au début des lignes
103 let line = getline(v:lnum)
104 let tabs = matchend(line,"^\t*")
105 let spaces = matchend(line,"^[ \t]*") - tabs
106 return tabs + ((spaces + 3) / 4)
108 set foldexpr=GetFoldExprFromIndent()
110 set foldlevelstart=99
111 set foldmethod=indent
121 set path=.,/usr/include,/usr/local/include,,
131 set maxmempattern=2000
141 "set runtimepath=$HOME/.vim,$VIMRUNTIME,$VIM
142 set sessionoptions=curdir,folds
146 "set statusline+=\ %l:%c
147 "set statusline=\ %{get(b:,'coc_current_function','')}
149 "set statusline+=%#ErrorMsg#%{CocStatusDiagnosticError()}%*
150 "set statusline+=\ %{CocStatus()}
151 set statusline+=%{LinterStatus()}
152 set statusline+=\ %m%R\ %Y
158 silent !mkdir -p ~/.cache/vim/view
159 set viewdir=$HOME/.cache/vim/view
160 set viminfo+=n$HOME/.cache/vim/info
163 set whichwrap+=<,>,[,]
164 set wildignore=*.a,*.d,*.o,*.so,*~,*.cmo,*.cmi,*.cmx,*.cmxs,*.cma,*.cmxa,*.byte,*.native,*.hi
166 set wildmode=list:longest,full
169 " When editing a file, always jump to the last known cursor position.
170 " Don't do it when the position is invalid or when inside an event handler
171 " (happens when dropping a file on gvim).
172 autocmd BufReadPost *
173 \ if line("'\"") > 0 && line("'\"") <= line("$") |
174 \ exe "normal g`\"" |
177 if (&term == "screen" || &term == "screen.linux")
181 if has("gui_running")
184 set titlestring=VIM:\ %F\ %a%r%m
195 "set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}
196 auto BufEnter * :set title | let &titlestring = 'VIM: ' . expand('%:p')
197 "auto VimLeave * :set t_ts=
\ek
\e\
199 let space = &shiftwidth == 0 ? &tabstop : &shiftwidth
200 if (&term == "linux" || &term == "screen.linux")
201 "set foldtext=substitute(getline(v\:foldstart),'^\\(\\s*\\)',{m->substitute(m[1],'\\('.repeat('\ ',&shiftwidth).'\\\|\\t\\)','\|'.repeat('.',&shiftwidth-1),'g')},'').'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
202 "set fillchars=fold:_
203 set list listchars=nbsp:+,tab:\|.,trail:_,extends:>,precedes:<
204 set foldtext=getline(v\:foldstart).'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
206 "set foldtext=substitute(getline(v\:foldstart),'^\\(\\s*\\)',{m->substitute(m[1],'\\('.repeat('\ ',&shiftwidth).'\\\|\\t\\)','⎢'.repeat('·',&shiftwidth-1),'g')},'').'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
207 "set fillchars=fold:·
208 set foldtext=getline(v\:foldstart).'\ \ ('.(v\:foldend-v\:foldstart+1).')\ '
209 set list listchars=nbsp:¬,tab:⎢·,trail:·,extends:>,precedes:<
212 "let g:indentLine_char_list = ['⎢']
213 "" Concealed text is not highlighted by the visual mode, this is annoying.
214 ""let g:indentLine_concealcursor = 'incv'
215 "let g:indentLine_faster = 1
216 "let g:indentLine_first_char = '⎢'
217 "let g:indentLine_leadingSpaceChar = '·'
218 "let g:indentLine_leadingSpaceEnabled = 1
219 "let g:indentLine_showFirstIndentLevel = 1
220 "let g:indentLine_bgcolor_term = 'NONE'
221 "let g:indentLine_defaultGroup = 'Folded'
223 if (v:version >= 700)
224 hi TabLine term=bold,reverse ctermfg=white ctermbg=blue cterm=none
225 hi TabLineFill term=bold,reverse ctermfg=none ctermbg=blue cterm=none
226 hi TabLineSel term=reverse ctermfg=white ctermbg=none cterm=bold
227 imap <C-S-tab> <Esc>:tabprevious<CR>i
228 imap <C-t> <Esc>:tabnew<CR>
229 imap <C-tab> <Esc>:tabnext<CR>i
230 nmap <C-S-tab> :tabprevious<CR>
231 nmap <Esc><tab> :bnext<CR>
232 nmap <C-t> :tabnew<CR>
233 "nmap <C-tab> :tabprevious<CR>
234 "nmap <tab> :tabnext<CR>
235 nmap <C-tab> :bprevious!<CR>
236 nmap <tab> :bnext!<CR>
237 nmap td :tabclose<CR>
238 nmap ti :tabfirst<CR>
243 nmap tn :tabnew<Space>
244 nmap tt :tabedit<Space>
245 nmap <C-i> :bprevious!<CR>
246 nmap <C-k> :bnext!<CR>
247 nmap <C-j> :lprevious<CR>
248 nmap <C-l> :lnext<CR>
249 nmap <C-u> :cprevious<CR>
250 nmap <C-o> :cnext<CR>
251 nmap <C-w>k :wincmd j<CR>
252 nmap <C-w>i :wincmd k<CR>
253 nmap <C-w>j :wincmd h<CR>
254 nmap <C-w>l :wincmd l<CR>
256 set sessionoptions+=tabpages
258 if (v:version >= 704)
259 silent !mkdir -p ~/.cache/vim/undo
260 set undodir=~/.cache/vim/undo/
262 autocmd BufWritePre /tmp/* setlocal noundofile
263 autocmd BufWritePre */sec/* setlocal noundofile
265 fun! TrimWhitespace()
266 let l:save = winsaveview()
267 keeppatterns %s/\s\+$//e
268 call winrestview(l:save)
270 autocmd BufRead .envrc setfiletype sh
271 "autocmd BufRead *.hamlet setfiletype html
272 "autocmd BufRead *.julius setfiletype javascript
273 "autocmd BufRead *.lucius setfiletype css
274 autocmd BufRead *.ledger setfiletype ledger
275 autocmd BufRead *.lhs setfiletype haskell
276 autocmd BufRead HLint.hs setfiletype txt
277 autocmd BufRead *.purs
278 \ setfiletype purescript |
280 "autocmd BufRead *.nix set syntax=zsh | set expandtab
281 autocmd BufNewFile,BufRead *.nix
282 \ hi nixAntiquotation ctermfg=cyan |
285 \ set foldmethod=indent
286 autocmd BufWritePre *.nix :call TrimWhitespace()
287 autocmd BufNewFile,BufRead *.py
291 autocmd BufNewFile,BufRead *.hs set expandtab
292 autocmd BufNewFile,BufRead *.tct set filetype=tct | set expandtab
293 autocmd BufWritePost * if &diff == 1 | diffupdate | endif
296 autocmd FileType qf setlocal wrap
298 " If doing a diff. Upon writing changes to file, automatically update the differences
303 let b:match_words = '«:»,“:”'
305 nmap <Leader>a <Plug>(EasyAlign)
306 vmap <Enter> <Plug>(EasyAlign)
307 let g:easy_align_ignore_groups = ['Comment', 'String', 'ledgerTransaction', 'ledgerTag', 'jccComment', 'jccTransaction']
309 let g:netrw_liststyle = 3
310 "let g:netrw_cursorline = 0
311 let s:netrw_usercul = 0
314 let g:buffergator_display_regime = "bufname"
315 let g:buffergator_show_full_directory_path = 0
316 let g:buffergator_viewport_split_policy = 'R'
317 let g:buffergator_autoupdate = 1
318 let g:buffergator_autodismiss_on_select = 0
319 let g:buffergator_suppress_keymaps = 1
320 nmap <leader>bq :bp <BAR> bd #<CR>
321 "let g:buffergator_mru_cycle_loop = 1
322 nmap <leader>i :BuffergatorMruCyclePrev<cr>
323 nmap <leader>k :BuffergatorMruCycleNext<cr>
324 nmap <leader>bl :BuffergatorOpen<cr>
325 nmap <leader>T :enew<cr>
326 set cpoptions+=M " ignore backslashes in % matching
328 let g:html_expand_tabs = 0
329 let g:html_ignore_conceal = 0
330 let g:html_ignore_folding = 1
331 let g:html_number_lines = 0
332 let g:html_use_xhtml = 0
334 "map <C-p> :CtrlPBuffer<CR>
335 "let g:ctrlp_working_path_mode = 'c'
336 "let g:ctrlp_map = '<Leader>t'
337 "let g:ctrlp_match_window_bottom = 0
338 "let g:ctrlp_match_window_reversed = 0
339 "let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
340 "let g:ctrlp_working_path_mode = 0
341 "let g:ctrlp_dotfiles = 0
342 "let g:ctrlp_switch_buffer = 0
345 "map <silent> tu :call GHC_BrowseAll()<CR>
346 "map <silent> tw :call GhcModType<CR>
347 map <silent> hc :GhcModTypeClear<CR>
348 map <silent> he :GhcModExpand<CR>
349 map <silent> hi :GhcModTypeInsert<CR>
350 map <silent> hs :GhcModSigCodegen<CR>
351 map <silent> hs :GhcModSplitFunCase<CR>
352 map <silent> ht :GhcModType<CR>
356 nmap <F5> :Hoogle <C-R><C-W><CR>
358 "let g:TimeKeeperUpdateFileTimeSec = 5
359 ""let g:TimeKeeperStartOnLoad = 1
360 "let g:TimeKeeperUseFlatFile = 0
361 "nmap <silent> <F8> :call TimeKeeper_ToggleTaskWindow()<cr>
362 "call TimeKeeper_StartTracking()
364 let g:RecoverPlugin_Delete_Unmodified_Swapfile = 1
366 let g:calendar_number_of_months = 1
367 let g:calendar_wruler = 'di lu ma me je ve sa'
368 let g:calendar_monday = 1
369 function MyCalAction(day,month,year,week,dir)
370 " day : day you actioned
371 " month : month you actioned
372 " year : year you actioned
373 " week : day of week (Mo=1 ... Su=7)
374 " dir : direction of calendar
376 "let calendar_action = 'MyCalAction'
377 "hi link ALEError Error
378 "hi Warning term=underline cterm=underline ctermfg=Yellow gui=undercurl guisp=Gold
379 "hi link ALEWarning Warning
380 "hi link ALEInfo SpellCap
382 "let g:echodoc#enable_at_startup = 1
383 "let g:echodoc#type = 'signature'
385 "let g:gitgutter_grep = 'rg'
386 let g:gitgutter_grep = 'grep'
387 let g:gitgutter_diff_args = '--diff-algorithm=histogram'
388 let g:gitgutter_map_keys = 0
389 let g:gitgutter_sign_added = '+'
390 let g:gitgutter_sign_modified = '±'
391 let g:gitgutter_sign_modified_removed = '-'
392 let g:gitgutter_sign_removed = '_'
393 let g:gitgutter_sign_removed_first_line = '▔'
394 let g:gitgutter_sign_priority = 9
395 hi GitGutterAdd ctermfg=green
396 hi GitGutterDelete ctermfg=red
397 hi GitGutterChange ctermfg=yellow
398 hi GitGutterChangeDelete ctermfg=red
399 nmap [c <Plug>(GitGutterPrevHunk)
400 nmap ]c <Plug>(GitGutterNextHunk)
401 nmap <Leader>p <Plug>(GitGutterPreviewHunk)
402 nmap <Leader>+ <Plug>(GitGutterStageHunk)
403 nmap <Leader>- <Plug>(GitGutterUndoHunk)
405 "let g:deoplete#enable_at_startup = 1
406 "call deoplete#custom#option('sources', {
407 "\ '_': ['ale', 'buffer', 'around'],