Last active
April 22, 2020 21:41
-
-
Save chrissound/b9bfc30dbb8dcc9f669ded1f48040561 to your computer and use it in GitHub Desktop.
Hacky but effective navigate to ghcid error with vim.. Might fail with spaces.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghcid -o /tmp2/err.ghcid --command='cabal v2-repl app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun! NavigateToGhcidError() | |
let g:myHaskellSrcPath = system('head -n 1 /tmp2/err.ghcid | cut -d":" -f1 | tr -d "\n"') | |
let g:myHaskellSrcLine = system('head -n 1 /tmp2/err.ghcid | cut -d":" -f2 | tr -d "\n"') | |
execute "normal! :e ". g:myHaskellSrcPath . "<CR>" | |
execute "normal! ". g:myHaskellSrcLine . "gg<CR>" | |
endfun | |
command! NavigateToGhcidError call NavigateToGhcidError() | |
map <leader>ge :NavigateToGhcidError<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment