My vim configuration
git clone https://github.com/m-col/vim-misc
Files | Refs | Readme

Commit a41d8c8b5f45d0baec42b47dcb06700881032034
Parent: fc7dc5ce952574571c3b1b4683fe151793417f23
Author: mcol <mcol@posteo.net>
Date: 2022-06-20 01:05:30 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2022-08-23 22:07:56 +0100

add ale and markdownfolding

vimrc Modified

@@ -25,6 +25,8 @@
     "Plugin 'gu-fan/riv.vim'
     Plugin 'https://mcol.xyz/code/vimlab'   " vimlab
     Plugin 'lervag/vimtex'		    " vimtex
+    Plugin 'dense-analysis/ale'             " ALE
+    Plugin 'neovimhaskell/haskell-vim'      " better haskell syntax highlighting
 endif
 
 Plugin 'https://gitlab.com/gi1242/vim-emoji-ab.git' " emoji input support
@@ -34,6 +36,7 @@
 Plugin 'https://mcol.xyz/code/tide'	    " tmux ide 
 "Plugin 'airblade/vim-gitgutter'		    " gitgutter
 Plugin 'Yggdroot/indentLine'                "Show indentation lines
+Plugin 'masukomi/vim-markdown-folding'      "markdown folding
 
 call vundle#end()			    " required
 filetype plugin indent on		    " required
@@ -65,9 +68,10 @@
 set softtabstop=4		" Number of spaces per tab
 set linebreak			" Allow backspacing over indention, line breaks and insertion start
 set backspace=indent,eol,start	" Backspace behaviour
-set formatoptions+=j		" Delete comment characters when joining lines.
+set formatoptions+=j	        " Delete comment characters when joining lines.
 autocmd FileType * setlocal formatoptions-=cro    " disable autocommenting
 set matchtime=2
+set conceallevel=0              " disable all concealing
 
 set undolevels=200		" Number of undo levels
 set undodir=~/.vim/undo//	" undo files
@@ -113,13 +117,14 @@
     let g:vimtex_view_general_options = '--unique @pdf\#src:@tex:@line:@col'
     let g:vimtex_view_qpdfview_hook_callback = 'ViewerCallback'
     let g:vimtex_compiler_latexmk = {'build_dir' : '.latex_build'}
+    let g:vimtex_syntax_conceal_disable = 1
     function! ViewerCallback() dict
         VimtexView
     endfunction
 
-    let g:riv_projects = [{ 'path': '~/git/phd', }]
-    let g:riv_disable_folding = 1
-    set mmp=2000
+    "let g:riv_projects = [{ 'path': '~/git/phd', }]
+    "let g:riv_disable_folding = 1
+    "set mmp=2000
 endif
 
 " Intelligently navigate tmux panes and Vim splits using the same keys.
@@ -143,3 +148,14 @@
 let g:markdown_syntax_conceal = 0
 
 runtime macros/emoji-ab.vim
+
+let g:ale_linters = {
+\   'haskell': ['hlint'],
+\   'python': ['flake8', 'mypy'],
+\}
+let g:ale_linters_explicit = 1
+let g:ale_lint_on_text_changed = 'never'
+let g:ale_lint_on_insert_leave = 0
+let g:ale_fixers = {}
+let g:ale_fixers.python = ['black', 'isort']
+let g:ale_fixers.haskell = ['ormolu']

plugin/keybindings.vim Modified

@@ -122,3 +122,7 @@
 inoremap <ScrollWheelUp> <Up>
 vnoremap <ScrollWheelDown> <Down>
 vnoremap <ScrollWheelUp> <Up>
+
+" ALE navigation
+nmap <silent> <C-S-k> <Plug>(ale_previous_wrap)
+nmap <silent> <C-S-j> <Plug>(ale_next_wrap)

plugin/folds.vim Modified

@@ -4,23 +4,23 @@
 
 
 " format folded section header text
-"function! GenericFoldText()
-"    let line = getline(v:foldstart)
-"
-"    let nucolwidth = &fdc + &number * &numberwidth
-"    let windowwidth = winwidth(0) - nucolwidth - 3
-"    let foldedlinecount = v:foldend - v:foldstart
-"
-"    let onetab = strpart('          ', 0, &tabstop)
-"    let line = substitute(line, '\t', onetab, 'g')
-"
-"    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
-"    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
-"    return line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
-"endfunction
-"set foldtext=GenericFoldText()
-"
-"
+function! GenericFoldText()
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+    return line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
+endfunction
+set foldtext=GenericFoldText()
+
+
 "function! GenericFolds()
 "    if match(getline(v:lnum), '^\s*' . &commentstring[0] . &commentstring[0]) >=0
 "	return ">1"

ftplugin/tex.vim Modified

@@ -8,4 +8,4 @@
 
 nnoremap <localleader>lw :exe 'cexpr system("texcount ' . expand('%') . '")'<CR>:copen<CR>
 
-nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
+nnoremap <localleader>c :VimtexCompile<CR>

ftplugin/markdown.vim Added

@@ -0,0 +1,23 @@
+setlocal textwidth=100
+"setlocal spell spelllang=en_gb
+nnoremap <localleader>c :mkview<CR>gqip:silent loadview<CR>
+
+
+" format folded section header text
+function! GenericFoldText()
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - len(foldedlinecount))
+    let level = (len(split(line)[0]) - 1) * 3
+    let level_indent = repeat(" ", level)
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - level
+    return level_indent . line . repeat(" ",fillcharcount) . ' ' . foldedlinecount
+endfunction
+setlocal foldtext=GenericFoldText()