From 495aa26e7f22cfd52e4d01253e80fd6718983868 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 28 Dec 2019 13:36:00 +0530 Subject: [PATCH] nvim: init.vim: Setup deoplete completion for Purescript Also allow auto imports from PSC IDE. Signed-off-by: Sanchayan Maity --- nvim/init.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nvim/init.vim b/nvim/init.vim index e70f0e4..a9d3fda 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -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 L :Plist au FileType purescript nmap l :Pload @@ -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; }'