Skip to content

Commit 412e8a7

Browse files
committed
fix a bug causing neovim to be confused when dealing with project using virtualenv, as some
of the plugin we use also use python
1 parent 9ece68e commit 412e8a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

provisioning/roles/neovim/files/init.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,12 @@ endfunc
8787
for dir in ["h", "j", "l", "k"]
8888
call s:mapMoveToWindowInDirection(dir)
8989
endfor
90+
91+
92+
" Figure out the system Python for Neovim.
93+
" otherwise neovim is confused by virtualenv of other projects
94+
if exists("$VIRTUAL_ENV")
95+
let g:python3_host_prog=substitute(system("which -a python3 | head -n2 | tail -n1"), "\n", '', 'g')
96+
else
97+
let g:python3_host_prog=substitute(system("which python3"), "\n", '', 'g')
98+
endif

0 commit comments

Comments
 (0)