diff options
Diffstat (limited to 'nvim')
-rw-r--r-- | nvim/.config/nvim/ftplugin/haskell.vim | 45 | ||||
-rw-r--r-- | nvim/.config/nvim/ftplugin/kotlin.vim | 19 | ||||
-rw-r--r-- | nvim/.config/nvim/ftplugin/scheme.vim | 8 |
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 @@ | |||
1 | function! s:OverwriteBuffer(output) | 1 | function! 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) |
8 | endfunction | 8 | endfunction |
9 | 9 | ||
10 | function! s:RunStylishHaskell() | 10 | function! 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 |
21 | endfunction | 21 | endfunction |
22 | 22 | ||
23 | augroup haskell-formatting | ||
24 | autocmd! | ||
25 | autocmd BufWritePost *.hs call s:RunStylishHaskell() | ||
26 | augroup END | ||
27 | |||
28 | |||
29 | set formatprg=stylish-haskell | 23 | set formatprg=stylish-haskell |
24 | set makeprg=hlint | ||
25 | |||
26 | augroup HaskellLint | ||
27 | autocmd! | ||
28 | autocmd BufWritePost *.hs | silent make! <afile> | silent redraw! | ||
29 | autocmd QuickFixCmdPost [^l]* cwindow | ||
30 | augroup 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 @@ | |||
1 | setlocal tabstop=4 | ||
2 | setlocal softtabstop=4 | ||
3 | setlocal shiftwidth=4 | ||
4 | setlocal expandtab | ||
5 | setlocal autoindent | ||
6 | setlocal smarttab | ||
7 | setlocal formatoptions=croql | ||
8 | |||
9 | setlocal comments=:// | ||
10 | setlocal commentstring=//\ %s | ||
11 | |||
12 | setlocal makeprg=ktlint | ||
13 | |||
14 | augroup KtLint | ||
15 | autocmd! | ||
16 | autocmd BufWritePost *.kt silent make! <afile> | silent redraw | ||
17 | autocmd QuickFixCmdPost [^l]* cwindow | ||
18 | augroup 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 | |||
6 | setlocal smarttab | 6 | setlocal smarttab |
7 | setlocal formatoptions=croql | 7 | setlocal formatoptions=croql |
8 | 8 | ||
9 | setlocal makeprg=guile-lint | ||
10 | |||
11 | augroup SchemeLint | ||
12 | autocmd! | ||
13 | autocmd BufWritePost *.scm silent make! <afile> | silent redraw | ||
14 | autocmd QuickFixCmdPost [^l]* cwindow | ||
15 | augroup END | ||
16 | |||
9 | CocDisable | 17 | CocDisable |