nvim: init.vim: Setup ghcid/hoogle based on environment

We may be running in a nix environment or without stack supported
project. Check this and setup the environment variable for ghcid and
hoogle plugin accordingly.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-01-01 12:18:30 +05:30
parent e2c94e87d6
commit e951bb849f

View file

@ -513,8 +513,17 @@ let g:haskell_indent_in = 1
let g:haskell_indent_guard = 2 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
let g:ghcid_command = 'stack exec -- ghcid' " Either check empty($IN_NIX_SHELL) for nix specific or executable('ghcid')
let g:hoogle_search_bin = 'stack exec -- hoogle' if executable('ghcid')
let g:ghcid_command = 'ghcid'
else
let g:ghcid_command = 'stack exec -- ghcid'
endif
if executable('hoogle')
let g:hoogle_search_bin = 'hoogle'
else
let g:hoogle_search_bin = 'stack exec -- hoogle'
endif
let g:hoogle_search_count = 30 let g:hoogle_search_count = 30
" Use deoplete " Use deoplete