From ddc6f72c5b1cf6916ef2705b226d0c53950b9386 Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 23 Jul 2024 20:26:43 +0100 Subject: init --- ftplugin/asm.vim | 1 + ftplugin/go.vim | 4 ++++ ftplugin/haskell.vim | 30 ++++++++++++++++++++++++++++++ ftplugin/javascript.vim | 8 ++++++++ ftplugin/kotlin.vim | 19 +++++++++++++++++++ ftplugin/python.vim | 8 ++++++++ ftplugin/rust.vim | 13 +++++++++++++ ftplugin/scheme.vim | 7 +++++++ ftplugin/tex.vim | 6 ++++++ ftplugin/typescript.vim | 7 +++++++ ftplugin/wiki.vim | 1 + 11 files changed, 104 insertions(+) create mode 100644 ftplugin/asm.vim create mode 100644 ftplugin/go.vim create mode 100644 ftplugin/haskell.vim create mode 100644 ftplugin/javascript.vim create mode 100644 ftplugin/kotlin.vim create mode 100644 ftplugin/python.vim create mode 100644 ftplugin/rust.vim create mode 100644 ftplugin/scheme.vim create mode 100644 ftplugin/tex.vim create mode 100644 ftplugin/typescript.vim create mode 100644 ftplugin/wiki.vim (limited to 'ftplugin') 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 @@ +setlocal noexpandtab +setlocal autoindent +setlocal smarttab +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 @@ +function! s:OverwriteBuffer(output) + let winview = winsaveview() + silent! undojoin + normal! gg"_dG + call append(0, split(a:output, '\v\n')) + normal! G"_dd + call winrestview(winview) +endfunction + +function! s:RunStylishHaskell() + let output = system("stylish-haskell" . " " . bufname("%")) + let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)') + if v:shell_error != 0 + echom output + elseif empty(errors) + call s:OverwriteBuffer(output) + write + else + echom errors + endif +endfunction + +set formatprg=stylish-haskell +set makeprg=hlint + +augroup HaskellLint + autocmd! + autocmd BufWritePost *.hs | call s:RunStylishHaskell() | silent make! | silent redraw! + autocmd QuickFixCmdPost [^l]* cwindow +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 @@ +setlocal tabstop=2 +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal formatoptions=croq +setlocal expandtab +setlocal autoindent +setlocal smarttab + 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 @@ +setlocal tabstop=4 +setlocal softtabstop=4 +setlocal shiftwidth=4 +setlocal expandtab +setlocal autoindent +setlocal smarttab +setlocal formatoptions=croql + +setlocal comments=:// +setlocal commentstring=//\ %s + +setlocal makeprg=ktlint + +augroup KtLint + autocmd! + autocmd BufWritePost *.kt silent make! | silent redraw + autocmd QuickFixCmdPost [^l]* cwindow +augroup END + 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 @@ +setlocal tabstop=4 +setlocal softtabstop=4 +setlocal shiftwidth=4 +setlocal expandtab +setlocal autoindent +setlocal smarttab +setlocal formatoptions=croql +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 @@ +setlocal ts=4 sts=4 sw=4 expandtab + +set formatprg=rustfmt +set errorformat= + \%-G, + \%-Gerror:\ aborting\ %.%#, + \%-Gerror:\ Could\ not\ compile\ %.%#, + \%Eerror:\ %m, + \%Eerror[E%n]:\ %m, + \%Wwarning:\ %m, + \%Inote:\ %m, + \%C\ %#-->\ %f:%l:%c, + \%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 @@ +setlocal tabstop=2 +setlocal softtabstop=2 +setlocal shiftwidth=2 +setlocal expandtab +setlocal autoindent +setlocal smarttab +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 @@ +setlocal wrap +setlocal number +nnoremap j gj +nnoremap k gk +let g:tex_conceal="abdmgs" +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 @@ +setlocal tabstop=2 +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal formatoptions=croq +setlocal expandtab +setlocal autoindent +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 -- cgit v1.2.3