nvim: init.vim: Add LC support for Haskell

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-07-11 15:56:36 +05:30
parent a165f535f4
commit de6b3f800d
1 changed files with 26 additions and 0 deletions

View File

@ -46,6 +46,10 @@ Plug 'l04m33/vlime', { 'rtp': '~/.config/nvim/plugged' }
Plug 'neovimhaskell/haskell-vim', { 'for': [ 'haskell', 'cabal' ] }
Plug 'parsonsmatt/intero-neovim'
Plug 'neomake/neomake'
Plug 'autozimu/LanguageClient-neovim' , {
\ 'branch' : 'next',
\ 'do' : './install.sh'
\ }
" For autocompletion
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Autocomplete for Python
@ -58,6 +62,7 @@ Plug 'tpope/vim-surround'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-eunuch'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'Shougo/echodoc.vim'
" Initialize plugin system
call plug#end()
@ -94,6 +99,7 @@ set tabstop=4 " Render TABs using this many spaces.
set shiftwidth=4 " Indentation amount for < and > commands.
set smarttab " Indent with tabs, align with spaces.
set expandtab " When on, uses space instead of tabs.
set cmdheight=2 " For echodoc
set noerrorbells " No beeps.
set modeline " Enable modeline.
@ -171,6 +177,26 @@ noremap <Left> <NOP>
noremap <Right> <NOP>
" For Haskell
let g:echodoc#enable_at_startup = 1
let g:echodoc#type = 'signature'
let g:LanguageClient_autoStart = 0
let g:LanguageClient_loggingFile = expand('$HOME/LC.log')
let g:LanguageClient_rootMarkers = ['stack.yaml']
let g:LanguageClient_serverCommands = { 'haskell': ['$HOME/.local/bin/hie-wrapper'] }
nnoremap <leader>ld :call LanguageClient#textDocument_definition()<CR>
nnoremap <leader>lr :call LanguageClient#textDocument_rename()<CR>
nnoremap <leader>lf :call LanguageClient#textDocument_formatting()<CR>
nnoremap <leader>lt :call LanguageClient#textDocument_typeDefinition()<CR>
nnoremap <leader>lx :call LanguageClient#textDocument_references()<CR>
nnoremap <leader>la :call LanguageClient_workspace_applyEdit()<CR>
nnoremap <leader>lc :call LanguageClient#textDocument_completion()<CR>
nnoremap <leader>lh :call LanguageClient#textDocument_hover()<CR>
nnoremap <leader>ls :call LanguageClient_textDocument_documentSymbol()<CR>
nnoremap <leader>lm :call LanguageClient_contextMenu()<CR>
nnoremap <Leader>la :call LanguageClient#textDocument_codeAction()<CR>
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`