Compare commits

..

8 Commits

4 changed files with 68 additions and 17 deletions

View File

@ -7,7 +7,45 @@ syntax on
filetype plugin indent on
call CmdAlias('hasktags', '!/home/jule/.cabal/bin/hasktags -c .<CR>')
" 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>')
map <leader>tg :codex<CR>
set tags=tags;/,codex.tags;/
nnoremap <leader>gd <C-]>
nnoremap <silent> <leader>cgd :cs find g <C-R>=expand("<cword>")<CR><CR>
nnoremap <silent> <C-\> :cs find c <C-R>=expand("<cword>")<CR><CR>
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()
"hoogle
nnoremap <leader>ho :Hoogle<CR>
nnoremap <leader>hc :HoogleClose<CR>
" haskell-vim
@ -58,7 +96,7 @@ let g:vim_annotations_offset = '/.liquid/'
" LSP
let g:LanguageClient_autoStart = 1
let g:LanguageClient_autoStart = 0
let g:LanguageClient_serverCommands = {
\ 'haskell': ['hie-wrapper', '--lsp', '-d', '-l', $HOME.'/lang-server.log'],
\ }
@ -66,16 +104,17 @@ let g:LanguageClient_serverCommands = {
let g:LanguageClient_diagnosticsEnable = 0
nnoremap <leader>lc :call LanguageClient_contextMenu()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <C-F6> :call LanguageClient#textDocument_hover()<CR>
vnoremap <silent> <C-F6> :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <F8> :call LanguageClient#textDocument_rename()<CR>
nnoremap <silent> <C-F8> :call LanguageClient#textDocument_rename()<CR>
" deoplete
call deoplete#custom#option('sources',{
\ '_': ['buffer'],
\ 'haskell': ['neosnippet', 'buffer', 'file', 'LanguageClient']
\ 'haskell': ['neosnippet', 'buffer', 'file', 'neco-ghc']
\ })
" \ 'haskell': ['neosnippet', 'buffer', 'file', 'neco-ghc']
" inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
call deoplete#enable()
call deoplete#enable_logging('DEBUG', $HOME . '/deoplete.log')
@ -83,8 +122,8 @@ call deoplete#enable_logging('DEBUG', $HOME . '/deoplete.log')
let g:ghcmod_hlint_options = ['--ignore=Eta reduce $']
" ALE
let g:ale_enabled = 1
let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools'], 'c':['clang']}
let g:ale_enabled = 0
let g:ale_linters = {'haskell':[], 'c':['clang']}
" let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools', 'argon'], 'c':['clang']}
" let g:ale_fixers = {
" \ 'haskell': ['brittany'],
@ -99,7 +138,6 @@ let g:ale_haskell_argon_info_level = 6
" neco-ghc
" let g:necoghc_enable_detailed_browse = 1
" let g:haskellmode_completion_ghc = 0
" let g:necoghc_enable_detailed_browse = 1
" autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
" let g:ycm_semantic_triggers = {'haskell' : ['.']}
@ -135,10 +173,16 @@ nmap <F6> :GhcModType<CR>
" let g:intero_window_size = 15
" " Sets the intero window to split vertically; default is horizontal
" let g:intero_vertical_split = 1
" " let g:intero_vertical_split = 1
" " let g:intero_ghci_options = '-dynamic'
" " OPTIONAL: Make the update time shorter, so the type info will trigger faster.
" set updatetime=1000
" map <silent> <leader>t <Plug>InteroGenericType
" nnoremap <silent> <leader>jd :InteroGoToDef<CR>
" map <silent> <leader>T <Plug>InteroType
" nnoremap <silent> <leader>it :InteroTypeInsert<CR>
" nnoremap <leader>ist :InteroSetTargets<SPACE>
" endif

View File

@ -0,0 +1,4 @@
snippet docsec
------------------------
--[ ${0:DOCUMENT SECTION} ]--
------------------------

View File

@ -0,0 +1,2 @@
snippet tc
\textcolor{${1:red}}{${0}}

17
vimrc
View File

@ -88,27 +88,27 @@ Plug 'w0rp/ale', {
" if has("nvim")
" Plug 'parsonsmatt/intero-neovim'
" endif
Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
" Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
" completion based on ghc-mod, not LSP
" Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
Plug 'neovimhaskell/haskell-vim', { 'for': ['haskell', 'cabal'] }
Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
" Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
Plug 'bitc/lushtags', {
\ 'do': 'bash -c \"cabal clean && cabal sandbox delete && cabal sandbox init && cabal install && cp .cabal-sandbox/bin/lushtags ~/.cabal/bin/lushtags\"',
\ 'do': 'bash -c \"stack install\"',
\ 'for': 'haskell',
\ }
" Plug 'timmytofu/vim-cabal-context', { 'for': 'haskell' }
Plug 'itchyny/vim-haskell-indent', { 'for': 'haskell' }
Plug 'dan-t/vim-hsimport', { 'for': 'haskell' }
Plug 'Twinside/vim-hoogle', { 'for': 'haskell' }
" clojure
" Plug '~/.vim/unmanaged-vim-plug/paredit', { 'for': 'clojure' }
" Plug '~/.vim/unmanaged-vim-plug/tslime', { 'for': 'clojure' }
Plug 'guns/vim-slamhound', {'for': 'clojure'}
Plug 'guns/vim-sexp', {'for': 'clojure'}
Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
Plug 'kovisoft/paredit', {'for': 'clojure'}
" Plug 'guns/vim-sexp', {'for': 'clojure'}
" Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
" Plug 'kovisoft/paredit', {'for': 'clojure'}
Plug 'tpope/vim-salve', { 'for': 'clojure' }
Plug 'tpope/vim-projectionist', { 'for': 'clojure' }
Plug 'tpope/vim-dispatch', { 'for': 'clojure' }
@ -183,6 +183,7 @@ if has('conceal')
endif
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
let g:neosnippet#snippets_directory='~/.vim/custom-snippets'
" vim airline
@ -193,7 +194,7 @@ let g:neosnippet#enable_snipmate_compatibility = 1
let g:LanguageClient_autoStart = 0
" deoplete
let g:deoplete#enable_at_startup = 0
let g:deoplete#enable_at_startup = 1
" ==== delimitMate ====
let g:delimitMate_matchpairs = "(:),[:],{:}"