diff --git a/nvim/.config/nvim/after/ftplugin/cabal.lua b/nvim/.config/nvim/after/ftplugin/cabal.lua deleted file mode 100644 index fc0ba12..0000000 --- a/nvim/.config/nvim/after/ftplugin/cabal.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = "-- %s" diff --git a/nvim/.config/nvim/after/ftplugin/cabal/cabalfmt.vim b/nvim/.config/nvim/after/ftplugin/cabal/cabalfmt.vim deleted file mode 100644 index 58c925c..0000000 --- a/nvim/.config/nvim/after/ftplugin/cabal/cabalfmt.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Taken from https://github.com/sdiehl/vim-cabalfmt - -if !exists("g:cabalfmt_command") - let g:cabalfmt_command = "cabal-fmt" -endif - -if !exists("g:cabalfmt_options") - let g:cabalfmt_options = [""] -endif - -function! s:OverwriteBuffer(output) - if &modifiable - let l:curw = winsaveview() - try | silent undojoin | catch | endtry - let splitted = split(a:output, '\n') - if line('$') > len(splitted) - execute len(splitted) .',$delete' - endif - call setline(1, splitted) - call winrestview(l:curw) - else - echom "Cannot write to non-modifiable buffer" - endif -endfunction - -function! s:RunCabal() - if exists("bufname") - let output = system(g:cabalfmt_command . " " . join(g:cabalfmt_options, ' ') . " " . bufname("%")) - else - let stdin = join(getline(1, '$'), "\n") - let output = system(g:cabalfmt_command . " " . join(g:cabalfmt_options, ' '), stdin) - endif - if v:shell_error != 0 - echom output - else - call s:OverwriteBuffer(output) - if exists("bufname") - write - endif - endif -endfunction - -function! s:CabalHaskell() - if executable(g:cabalfmt_command) - call s:RunCabal() - else - echom "cabal-fmt executable not found" - endif -endfunction - -function! RunCabal() - call s:CabalHaskell() -endfunction - -nnoremap gq :call RunCabal()