nvim: init.vim: Use neovim-ghci

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-11-01 22:47:33 +05:30
parent 83469d1496
commit 07dffc32f4

View file

@ -52,6 +52,7 @@ Plug 'Olical/vim-scheme', { 'for': 'scheme', 'on': 'SchemeConnect' }
" Haskell " Haskell
Plug 'ekmett/haskell-vim', { 'for': [ 'haskell', 'cabal' ] } Plug 'ekmett/haskell-vim', { 'for': [ 'haskell', 'cabal' ] }
Plug 'neomake/neomake' Plug 'neomake/neomake'
Plug 'SanchayanMaity/neovim-ghci'
" For Nix " For Nix
Plug 'LnL7/vim-nix', { 'for': 'nix' } Plug 'LnL7/vim-nix', { 'for': 'nix' }
" For autocompletion " For autocompletion
@ -217,6 +218,34 @@ noremap <Down> <NOP>
noremap <Left> <NOP> noremap <Left> <NOP>
noremap <Right> <NOP> noremap <Right> <NOP>
augroup ghciMaps
au!
" Maps for ghci. Restrict to Haskell buffers so the bindings don't collide.
" Background process and window management
au FileType haskell nnoremap <silent> <leader>is :GhciStart<CR>
au FileType haskell nnoremap <silent> <leader>ik :GhciKill<CR>
" Restarting GHCi might be required if you addinew dependencies
au FileType haskell nnoremap <silent> <leader>ir :GhciRestart<CR>
" Open GHCi split horizontally
au FileType haskell nnoremap <silent> <leader>io :GhciOpen<CR>
" Open GHCi split vertically
au FileType haskell nnoremap <silent> <leader>iov :GhciOpen<CR><C-W>H
au FileType haskell nnoremap <silent> <leader>ih :GhciHide<CR>
au FileType haskell nnoremap <silent> <leader>it :GhciType<CR>
au FileType haskell nnoremap <silent> <leader>ii :GhciInfo<CR>
au FileType haskell nnoremap <silent> <leader>ie :GhciEval<CR>
" Manually save and reload
au FileType haskell nnoremap <silent> <leader>ir :w \| :GhciReload<CR>
" Load individual modules
au FileType haskell nnoremap <silent> <leader>il :GhciLoadCurrentModule<CR>
au FileType haskell nnoremap <silent> <leader>if :GhciLoadCurrentFile<CR>
augroup END
augroup deopleteMaps augroup deopleteMaps
au! au!
" For deoplete Rust " For deoplete Rust
@ -260,6 +289,14 @@ let g:haskell_indent_guard = 2
let g:haskell_indent_case_alternative = 1 let g:haskell_indent_case_alternative = 1
let g:cabal_indent_section = 2 let g:cabal_indent_section = 2
" GHCi starts automatically. Set this if you'd like to prevent that.
let g:ghci_start_immediately = 0
" Customize how to run GHCi
let g:ghci_command = 'stack repl'
let g:ghci_command_line_options = '--ghci-options="-fobject-code"'
let g:ghci_use_neomake = 1
" Use deoplete " Use deoplete
let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_at_startup = 1
" Disable autocomplete by default " Disable autocomplete by default