vim-config/after/ftplugin/haskell.vim

52 lines
1.3 KiB
VimL
Raw Normal View History

2018-06-15 17:02:14 +00:00
setlocal ts=2 sw=2 expandtab
2018-05-26 17:18:09 +00:00
2018-07-08 08:54:08 +00:00
" tags
call CmdAlias('hasktags', '!hasktags -c .<CR>')
" from
" https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/git-hscope
call CmdAlias('codex', 'call system("haskell-ctags")<CR><CR>call LoadHscope()<CR>')
2020-10-11 11:50:17 +00:00
call CmdAlias('Cc', 'Clap commits<CR>')
2018-07-08 08:54:08 +00:00
map <leader>ctg :codex<CR>
2018-07-08 08:54:08 +00:00
set tags=tags;/,codex.tags;/
2020-01-08 23:37:57 +00:00
" nnoremap <silent> <leader>cgd :cs find g <C-R>=expand("<cword>")<CR><CR>
2018-07-08 08:54:08 +00:00
nnoremap <silent> <C-\> :cs find c <C-R>=expand("<cword>")<CR><CR>
2020-10-18 17:45:39 +00:00
" set cscopeprg=do_at_stack_root\ hscope
2018-07-08 08:54:08 +00:00
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
2020-10-18 17:45:39 +00:00
" au BufEnter /*.hs call LoadHscope()
2018-05-26 17:18:09 +00:00
2020-01-25 18:22:22 +00:00
call deoplete#enable()
call deoplete#custom#source('LanguageClient',
2020-10-11 11:50:17 +00:00
\ 'min_pattern_length',
\ 2)
2020-01-25 18:22:22 +00:00
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
2020-08-22 18:37:20 +00:00
2020-10-11 15:55:02 +00:00
" vim-lsp
if executable('haskell-language-server-wrapper')
au User lsp_setup call lsp#register_server({
\ 'name': 'hls',
\ 'cmd': {server_info->['haskell-language-server-wrapper', '--lsp']},
\ 'allowlist': ['haskell'],
\ })
endif