diff options
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/asm.vim | 1 | ||||
-rw-r--r-- | ftplugin/go.vim | 4 | ||||
-rw-r--r-- | ftplugin/haskell.vim | 30 | ||||
-rw-r--r-- | ftplugin/javascript.vim | 8 | ||||
-rw-r--r-- | ftplugin/kotlin.vim | 19 | ||||
-rw-r--r-- | ftplugin/python.vim | 8 | ||||
-rw-r--r-- | ftplugin/rust.vim | 13 | ||||
-rw-r--r-- | ftplugin/scheme.vim | 7 | ||||
-rw-r--r-- | ftplugin/tex.vim | 6 | ||||
-rw-r--r-- | ftplugin/typescript.vim | 7 | ||||
-rw-r--r-- | ftplugin/wiki.vim | 1 |
11 files changed, 104 insertions, 0 deletions
diff --git a/ftplugin/asm.vim b/ftplugin/asm.vim new file mode 100644 index 0000000..dde370b --- /dev/null +++ b/ftplugin/asm.vim | |||
@@ -0,0 +1 @@ | |||
syntax off | |||
diff --git a/ftplugin/go.vim b/ftplugin/go.vim new file mode 100644 index 0000000..6efd1fe --- /dev/null +++ b/ftplugin/go.vim | |||
@@ -0,0 +1,4 @@ | |||
1 | setlocal noexpandtab | ||
2 | setlocal autoindent | ||
3 | setlocal smarttab | ||
4 | setlocal formatoptions=croql | ||
diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim new file mode 100644 index 0000000..651f033 --- /dev/null +++ b/ftplugin/haskell.vim | |||
@@ -0,0 +1,30 @@ | |||
1 | function! s:OverwriteBuffer(output) | ||
2 | let winview = winsaveview() | ||
3 | silent! undojoin | ||
4 | normal! gg"_dG | ||
5 | call append(0, split(a:output, '\v\n')) | ||
6 | normal! G"_dd | ||
7 | call winrestview(winview) | ||
8 | endfunction | ||
9 | |||
10 | function! s:RunStylishHaskell() | ||
11 | let output = system("stylish-haskell" . " " . bufname("%")) | ||
12 | let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)') | ||
13 | if v:shell_error != 0 | ||
14 | echom output | ||
15 | elseif empty(errors) | ||
16 | call s:OverwriteBuffer(output) | ||
17 | write | ||
18 | else | ||
19 | echom errors | ||
20 | endif | ||
21 | endfunction | ||
22 | |||
23 | set formatprg=stylish-haskell | ||
24 | set makeprg=hlint | ||
25 | |||
26 | augroup HaskellLint | ||
27 | autocmd! | ||
28 | autocmd BufWritePost *.hs | call s:RunStylishHaskell() | silent make! <afile> | silent redraw! | ||
29 | autocmd QuickFixCmdPost [^l]* cwindow | ||
30 | augroup END | ||
diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim new file mode 100644 index 0000000..454c153 --- /dev/null +++ b/ftplugin/javascript.vim | |||
@@ -0,0 +1,8 @@ | |||
1 | setlocal tabstop=2 | ||
2 | setlocal shiftwidth=2 | ||
3 | setlocal softtabstop=2 | ||
4 | setlocal formatoptions=croq | ||
5 | setlocal expandtab | ||
6 | setlocal autoindent | ||
7 | setlocal smarttab | ||
8 | |||
diff --git a/ftplugin/kotlin.vim b/ftplugin/kotlin.vim new file mode 100644 index 0000000..d001ac1 --- /dev/null +++ b/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/ftplugin/python.vim b/ftplugin/python.vim new file mode 100644 index 0000000..89b7508 --- /dev/null +++ b/ftplugin/python.vim | |||
@@ -0,0 +1,8 @@ | |||
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 | setlocal formatprg=yapf | ||
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim new file mode 100644 index 0000000..50645fa --- /dev/null +++ b/ftplugin/rust.vim | |||
@@ -0,0 +1,13 @@ | |||
1 | setlocal ts=4 sts=4 sw=4 expandtab | ||
2 | |||
3 | set formatprg=rustfmt | ||
4 | set errorformat= | ||
5 | \%-G, | ||
6 | \%-Gerror:\ aborting\ %.%#, | ||
7 | \%-Gerror:\ Could\ not\ compile\ %.%#, | ||
8 | \%Eerror:\ %m, | ||
9 | \%Eerror[E%n]:\ %m, | ||
10 | \%Wwarning:\ %m, | ||
11 | \%Inote:\ %m, | ||
12 | \%C\ %#-->\ %f:%l:%c, | ||
13 | \%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z | ||
diff --git a/ftplugin/scheme.vim b/ftplugin/scheme.vim new file mode 100644 index 0000000..784bf29 --- /dev/null +++ b/ftplugin/scheme.vim | |||
@@ -0,0 +1,7 @@ | |||
1 | setlocal tabstop=2 | ||
2 | setlocal softtabstop=2 | ||
3 | setlocal shiftwidth=2 | ||
4 | setlocal expandtab | ||
5 | setlocal autoindent | ||
6 | setlocal smarttab | ||
7 | setlocal formatoptions=croql | ||
diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim new file mode 100644 index 0000000..515fb7a --- /dev/null +++ b/ftplugin/tex.vim | |||
@@ -0,0 +1,6 @@ | |||
1 | setlocal wrap | ||
2 | setlocal number | ||
3 | nnoremap j gj | ||
4 | nnoremap k gk | ||
5 | let g:tex_conceal="abdmgs" | ||
6 | let g:tex_fold_enabled=1 | ||
diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim new file mode 100644 index 0000000..c6132bb --- /dev/null +++ b/ftplugin/typescript.vim | |||
@@ -0,0 +1,7 @@ | |||
1 | setlocal tabstop=2 | ||
2 | setlocal shiftwidth=2 | ||
3 | setlocal softtabstop=2 | ||
4 | setlocal formatoptions=croq | ||
5 | setlocal expandtab | ||
6 | setlocal autoindent | ||
7 | setlocal smarttab | ||
diff --git a/ftplugin/wiki.vim b/ftplugin/wiki.vim new file mode 100644 index 0000000..88a5339 --- /dev/null +++ b/ftplugin/wiki.vim | |||
@@ -0,0 +1 @@ | |||
set textwidth=72 | |||