Skip to content

Instantly share code, notes, and snippets.

@chrissound
Last active April 22, 2020 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrissound/b9bfc30dbb8dcc9f669ded1f48040561 to your computer and use it in GitHub Desktop.
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.
ghcid -o /tmp2/err.ghcid --command='cabal v2-repl app'
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