Compare commits
2 commits
10bc8ef6c3
...
da404ea629
Author | SHA1 | Date | |
---|---|---|---|
da404ea629 | |||
1ff22b3a00 |
4 changed files with 0 additions and 79 deletions
|
@ -1 +0,0 @@
|
||||||
vim.bo.commentstring = "-- %s"
|
|
|
@ -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 <buffer> <silent> gq :call RunCabal()<CR>
|
|
|
@ -4,5 +4,4 @@ tmuxp load -d personal
|
||||||
tmuxp load -d gstreamer
|
tmuxp load -d gstreamer
|
||||||
tmuxp load -d work
|
tmuxp load -d work
|
||||||
tmuxp load -d audio-dev
|
tmuxp load -d audio-dev
|
||||||
tmuxp load -d haskell
|
|
||||||
tmuxp load -d rust
|
tmuxp load -d rust
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
session_name: Haskell
|
|
||||||
windows:
|
|
||||||
- window_name: Haskell-1
|
|
||||||
start_directory: "~/GitSources/Haskell"
|
|
||||||
panes:
|
|
||||||
-
|
|
||||||
- window_name: Haskell-2
|
|
||||||
start_directory: "~/GitSources/Haskell"
|
|
||||||
panes:
|
|
||||||
-
|
|
||||||
- window_name: Haskell-3
|
|
||||||
start_directory: "~/GitSources/Haskell"
|
|
||||||
panes:
|
|
||||||
-
|
|
||||||
- window_name: Haskell-4
|
|
||||||
start_directory: "~/GitSources/Haskell"
|
|
||||||
panes:
|
|
||||||
-
|
|
||||||
- window_name: Haskell-5
|
|
||||||
start_directory: "~/GitSources/Haskell"
|
|
||||||
panes:
|
|
||||||
-
|
|
Loading…
Reference in a new issue