summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-07-23 20:26:43 +0100
committerAkshay <[email protected]>2024-07-23 20:26:43 +0100
commitddc6f72c5b1cf6916ef2705b226d0c53950b9386 (patch)
tree56b1d651dfe18a5e45b8cc6477ff8cb49991d98c /ftplugin
init
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/asm.vim1
-rw-r--r--ftplugin/go.vim4
-rw-r--r--ftplugin/haskell.vim30
-rw-r--r--ftplugin/javascript.vim8
-rw-r--r--ftplugin/kotlin.vim19
-rw-r--r--ftplugin/python.vim8
-rw-r--r--ftplugin/rust.vim13
-rw-r--r--ftplugin/scheme.vim7
-rw-r--r--ftplugin/tex.vim6
-rw-r--r--ftplugin/typescript.vim7
-rw-r--r--ftplugin/wiki.vim1
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 @@
1setlocal noexpandtab
2setlocal autoindent
3setlocal smarttab
4setlocal 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 @@
1function! 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)
8endfunction
9
10function! 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
21endfunction
22
23set formatprg=stylish-haskell
24set makeprg=hlint
25
26augroup HaskellLint
27 autocmd!
28 autocmd BufWritePost *.hs | call s:RunStylishHaskell() | silent make! <afile> | silent redraw!
29 autocmd QuickFixCmdPost [^l]* cwindow
30augroup 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 @@
1setlocal tabstop=2
2setlocal shiftwidth=2
3setlocal softtabstop=2
4setlocal formatoptions=croq
5setlocal expandtab
6setlocal autoindent
7setlocal 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 @@
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/ftplugin/python.vim b/ftplugin/python.vim
new file mode 100644
index 0000000..89b7508
--- /dev/null
+++ b/ftplugin/python.vim
@@ -0,0 +1,8 @@
1setlocal tabstop=4
2setlocal softtabstop=4
3setlocal shiftwidth=4
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal formatoptions=croql
8setlocal 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 @@
1setlocal ts=4 sts=4 sw=4 expandtab
2
3set formatprg=rustfmt
4set 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 @@
1setlocal tabstop=2
2setlocal softtabstop=2
3setlocal shiftwidth=2
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal 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 @@
1setlocal wrap
2setlocal number
3nnoremap j gj
4nnoremap k gk
5let g:tex_conceal="abdmgs"
6let 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 @@
1setlocal tabstop=2
2setlocal shiftwidth=2
3setlocal softtabstop=2
4setlocal formatoptions=croq
5setlocal expandtab
6setlocal autoindent
7setlocal 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