augroup haskell autocmd! autocmd FileType haskell call Def_haskell() augroup END function! Def_haskell() " tags set tags=tags;/,codex.tags;/ set formatprg=par set csprg=hscope set csto=1 " search codex tags first let $PARINIT = 'rTbgqR B=.,?_A_a Q=_s>|' au BufEnter /*.hs call LoadHscope() let g:tagbar_type_haskell = { \ 'ctagsbin' : 'hasktags', \ 'ctagsargs' : '-x -c -o-', \ 'kinds' : [ \ 'm:modules:0:1', \ 'd:data: 0:1', \ 'd_gadt: data gadt:0:1', \ 't:type names:0:1', \ 'nt:new types:0:1', \ 'c:classes:0:1', \ 'cons:constructors:1:1', \ 'c_gadt:constructor gadt:1:1', \ 'c_a:constructor accessors:1:1', \ 'ft:function types:1:1', \ 'fi:function implementations:0:1', \ 'o:others:0:1' \ ], \ 'sro' : '.', \ 'kind2scope' : { \ 'm' : 'module', \ 'c' : 'class', \ 'd' : 'data', \ 't' : 'type' \ }, \ 'scope2kind' : { \ 'module' : 'm', \ 'class' : 'c', \ 'data' : 'd', \ 'type' : 't' \ } \ } function! LoadHscope() let db = findfile("hscope.out", ".;") if (!empty(db)) let path = strpart(db, 0, match(db, "/hscope.out$")) set nocscopeverbose " suppress 'duplicate connection' error exe "cs add " . db . " " . path set cscopeverbose endif endfunction " lint let g:hlintRefactor#disableDefaultKeybindings = 1 " Point Conversion (これは単体で動く) function! Pointfree() call setline('.', split(system('pointfree '.shellescape(join(getline(a:firstline, a:lastline), "\n"))), "\n")) endfunction function! Pointful() call setline('.', split(system('pointful '.shellescape(join(getline(a:firstline, a:lastline), "\n"))), "\n")) endfunction " binding nnoremap :cs find c =expand("") nnoremap tg :!codex update --force:call system("git-hscope -X TemplateHaskell"):call LoadHscope() nnoremap hh :Hoogle nnoremap hH :Hoogle nnoremap hi :HoogleInfo nnoremap hI :HoogleInfo nnoremap hz :HoogleClose nnoremap :noh:GhcModTypeClear nnoremap ht :GhcModType nnoremap hT :GhcModTypeInsert nnoremap hc :Neomake ghcmod nnoremap hr :call ApplyOneSuggestion() nnoremap hR :call ApplyAllSuggestions() nnoremap hl :Neomake hlint vnoremap h. :call Pointfree() vnoremap h> :call Pointful() endfunction