aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-11-20 05:51:42 +0000
committerAkshay <[email protected]>2020-11-20 05:51:42 +0000
commit4c7b6751ee381993e448ab43766555bf178ae28c (patch)
tree0cc5a4759ae8d448f051179637f265a929cc391a
parent381f7807521b71595614c6bbe5bdcce2c68c3f8c (diff)
add hlint + qf integration
-rw-r--r--nvim/.config/nvim/ftplugin/haskell.vim45
-rw-r--r--nvim/.config/nvim/ftplugin/kotlin.vim19
-rw-r--r--nvim/.config/nvim/ftplugin/scheme.vim8
3 files changed, 50 insertions, 22 deletions
diff --git a/nvim/.config/nvim/ftplugin/haskell.vim b/nvim/.config/nvim/ftplugin/haskell.vim
index c389121..5bcdd4c 100644
--- a/nvim/.config/nvim/ftplugin/haskell.vim
+++ b/nvim/.config/nvim/ftplugin/haskell.vim
@@ -1,29 +1,30 @@
1function! s:OverwriteBuffer(output) 1function! s:OverwriteBuffer(output)
2 let winview = winsaveview() 2 let winview = winsaveview()
3 silent! undojoin 3 silent! undojoin
4 normal! gg"_dG 4 normal! gg"_dG
5 call append(0, split(a:output, '\v\n')) 5 call append(0, split(a:output, '\v\n'))
6 normal! G"_dd 6 normal! G"_dd
7 call winrestview(winview) 7 call winrestview(winview)
8endfunction 8endfunction
9 9
10function! s:RunStylishHaskell() 10function! s:RunStylishHaskell()
11 let output = system("stylish-haskell" . " " . bufname("%")) 11 let output = system("stylish-haskell" . " " . bufname("%"))
12 let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)') 12 let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)')
13 if v:shell_error != 0 13 if v:shell_error != 0
14 echom output 14 echom output
15 elseif empty(errors) 15 elseif empty(errors)
16 call s:OverwriteBuffer(output) 16 call s:OverwriteBuffer(output)
17 write 17 write
18 else 18 else
19 echom errors 19 echom errors
20 endif 20 endif
21endfunction 21endfunction
22 22
23augroup haskell-formatting
24 autocmd!
25 autocmd BufWritePost *.hs call s:RunStylishHaskell()
26augroup END
27
28
29set formatprg=stylish-haskell 23set formatprg=stylish-haskell
24set makeprg=hlint
25
26augroup HaskellLint
27 autocmd!
28 autocmd BufWritePost *.hs | silent make! <afile> | silent redraw!
29 autocmd QuickFixCmdPost [^l]* cwindow
30augroup END
diff --git a/nvim/.config/nvim/ftplugin/kotlin.vim b/nvim/.config/nvim/ftplugin/kotlin.vim
new file mode 100644
index 0000000..d001ac1
--- /dev/null
+++ b/nvim/.config/nvim/ftplugin/kotlin.vim
@@ -0,0 +1,19 @@
1setlocal tabstop=4
2setlocal softtabstop=4
3setlocal shiftwidth=4
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal formatoptions=croql
8
9setlocal comments=://
10setlocal commentstring=//\ %s
11
12setlocal makeprg=ktlint
13
14augroup KtLint
15 autocmd!
16 autocmd BufWritePost *.kt silent make! <afile> | silent redraw
17 autocmd QuickFixCmdPost [^l]* cwindow
18augroup END
19
diff --git a/nvim/.config/nvim/ftplugin/scheme.vim b/nvim/.config/nvim/ftplugin/scheme.vim
index 2b6c296..4af180c 100644
--- a/nvim/.config/nvim/ftplugin/scheme.vim
+++ b/nvim/.config/nvim/ftplugin/scheme.vim
@@ -6,4 +6,12 @@ setlocal autoindent
6setlocal smarttab 6setlocal smarttab
7setlocal formatoptions=croql 7setlocal formatoptions=croql
8 8
9setlocal makeprg=guile-lint
10
11augroup SchemeLint
12 autocmd!
13 autocmd BufWritePost *.scm silent make! <afile> | silent redraw
14 autocmd QuickFixCmdPost [^l]* cwindow
15augroup END
16
9CocDisable 17CocDisable