From 9347f35352afa59da5930957e746cdae5fc2c622 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 8 Jul 2018 16:54:08 +0800 Subject: [PATCH] Fix hasktags and hscope --- after/ftplugin/haskell.vim | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/after/ftplugin/haskell.vim b/after/ftplugin/haskell.vim index fec045f..a4cca4d 100644 --- a/after/ftplugin/haskell.vim +++ b/after/ftplugin/haskell.vim @@ -7,7 +7,38 @@ syntax on filetype plugin indent on -call CmdAlias('hasktags', '!/home/jule/.cabal/bin/hasktags -c .') +" tags +call CmdAlias('hasktags', '!hasktags -c .') + +" from +" https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/git-hscope +call CmdAlias('codex', 'call system("haskell-ctags")call LoadHscope()') + + +map tg :codex +set tags=tags;/,codex.tags;/ + +nnoremap gd +nnoremap cgd :cs find g =expand("") +nnoremap :cs find c =expand("") + +set cscopeprg=do_at_stack_root\ hscope +set csre +set csto=1 " search codex tags first +set nocst +" set cscopequickfix=s-,c-,d-,i-,t-,e-,a- + +function! LoadHscope() + set nocscopeverbose " suppress 'duplicate connection' error + let hsf = findfile("hscope.out", ".;") + if filereadable(hsf) + exe "cs add " . hsf + elseif $HSCOPE_DB != "" + cs add $HSCOPE_DB + endif + set cscopeverbose +endfunction +au BufEnter /*.hs call LoadHscope() " haskell-vim