Skip to content

Instantly share code, notes, and snippets.

@srishanbhattarai
Created February 24, 2018 07:12
Show Gist options
  • Save srishanbhattarai/41012cece60960a24b9a463786893f61 to your computer and use it in GitHub Desktop.
Save srishanbhattarai/41012cece60960a24b9a463786893f61 to your computer and use it in GitHub Desktop.
Cross platform Python paths for Neovim
if (has('nvim'))
" Path to Python2 and Python3 binaries which are required by some plugins.
" A function that runs the shell `which` command and sanitizes the output.
function! Which(cmd)
return substitute(system("which " . a:cmd), "\n", "", "")
endfunction
let g:python_host_prog = Which("python2")
let g:python3_host_prog = Which("python3")
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment