Reputation: 696
I've read quite a few posts/documentations about Vim's visual block feature (such as prepend not working), however, I'm still not able to apply a visual block prepend operation to multiple lines when I'm using Vim called from a Git Bash terminal. If I'm using Windows' cmd or Windows Power Shell it works just fine.
To be clear, from inside a vim buffer that was created via the Git Bash version 2.16.windows.1 environment, I follow the following steps:
Note that only one line received a prefix character. If I follow the same steps from cmd or powershell the prefix character is applied to all lines selected.
Is there a workaround to this? Is this a known Vim bug? Or is Git somehow interfering with Vim features?
Upvotes: 0
Views: 1052
Reputation: 124
It seems like the vim that you are using is the one that came installed with git-bash, since vim works like you'd expect from within powershell and cmd prompt.
Follow the steps here to see if changing the vim version to your own makes the visual block prepend feature work. https://superuser.com/questions/423532/how-do-i-use-installed-vim-in-git-bash-instead-of-the-one-that-came-with-git
From top answer by 'nevermind':
By default Git runs vim from Git\bin\vim. This is actually a script that contains path to the executable itself:
#!/bin/sh exec /share/vim/vim73/vim "$@"
Therefore you can edit this file to point to your Git location.
The default editor can be overridden in Git\etc\gitconfig:
[core] editor = path_to_your_editor
I hope this helps!
Upvotes: 1