How do I add Python support in Vim in Git Bash?
Asked Answered
M

2

11

I want to add Python support in Vim in Git Bash, how do I do this?

I get false when running:

:echo has('python')
Meza answered 4/11, 2015 at 10:47 Comment(1)
very late response but had similar issue. not an answer but an alternative to using Vim in Git Bash, is to use vim_x64 by bintray.com/veegee/generic/vim_x64. excellent, picks up whatever python you have on path so works well with conda envs alsoIridissa
P
1

TL;DR: Install MSYS2 instead, a "superset" of git bash, that also comes with a package manager.


This ticket shows up in the git-for-windows issue tracker, and was closed with the following reason:

This function is not required for Git for Windows to work. In fact, Python is not required for Git for Windows to work, therefore we do not ship it to the end user.

The purpose of Git for Windows is really to bring Git to Windows.

While that implies that we have to ship quite a few Unix-like tools, it does not mean that we will include such tools unless they are needed for Git's own operations, or at least for historical reasons (needs of active contributors are sometimes a factor in deciding whether to include a tool or not).

Having said that, what you really are looking for is MSYS2. Git for Windows leverages MSYS2 and ships with a subset of its files. MSYS2 even sports a package management system called "pacman" to install more tools (including Git...), so why don't you give it a whirl?

I guess you could go ahead re-install or re-compile vim with Python support, a better course of action seems to be the one suggested.

Psychometrics answered 4/10, 2017 at 17:44 Comment(0)
A
0

You can add the path to a python.exe in your git bash session

# move to $HOME first
cd
echo 'export PATH="$PATH:/c/Python27"' > .profile

Then Vim will be more likely to detect python.

Make sure to use the latest git for Windows release.

Audacious answered 5/11, 2015 at 5:26 Comment(2)
AFAICT the msys vim bundled with Git for Windows doesn't want a python.exe, it wants a msys-python2.7.dll.Theressa
OK, I'll check that out later, it uses msys2Audacious

© 2022 - 2024 — McMap. All rights reserved.