nvim: init.vim: Setup deoplete completion for Purescript

Also allow auto imports from PSC IDE.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-12-28 13:36:00 +05:30
parent df3b9f5b0b
commit 495aa26e7f

View file

@ -378,7 +378,7 @@ augroup haskell_maps
au FileType haskell setlocal keywordprg=:Hoogle
augroup END
augroup psc_ide_maps
augroup purescript_maps
au!
au FileType purescript nmap <buffer> <silent> <LocalLeader>L :Plist<CR>
au FileType purescript nmap <buffer> <silent> <LocalLeader>l :Pload<CR>
@ -523,7 +523,14 @@ call deoplete#custom#source('_',
call deoplete#custom#option('sources', {
\ '_' : ['buffer', 'tag', 'around', 'file', 'member'],
\ 'rust': ['racer'],
\ 'purescript': ['buffer', 'omni'],
\})
call deoplete#custom#source('omni', 'functions', {
\ 'purescript': 'PSCIDEComplete',
\})
call deoplete#custom#var('omni', 'input_patterns', {
\ 'purescript': '\w*',
\})
call deoplete#custom#option({
\ 'auto_complete_delay': 200,
\ 'auto_complete': v:true,
@ -654,6 +661,9 @@ let g:netrw_winsize = 10
" For SLIMV
let g:lisp_rainbow=1
" For Purescript
let g:psc_ide_auto_imports = 1
" ----------------------------- Functions ------------------------------------
function! Cscope(option, query)
let color = '{ x = $1; $1 = ""; z = $3; $3 = ""; printf "\033[34m%s\033[0m:\033[31m%s\033[0m\011\033[37m%s\033[0m\n", x,z,$0; }'