Open ShrykeWindgrace opened 2 years ago
need windows user support for this
I did a bit of digging
vim
in my $PATH
is, in fact, a bat
script:
PS> (Get-Command vim).Name
vim.bat
%PATHEXT%
($env:PATHEXT
in pwsh
) env variable that specifies the list of extensions to test if the command's extension is not provided. (see also https://learn.microsoft.com/en-us/previous-versions/cc723564(v=technet.10)#command-search-sequence and https://stackoverflow.com/a/1653492/3206165)externaleditor.rs:115
) does not do these extension checks and only tries to run the provided executable as-is.I see the following solutions:
git
's config in a cross-platform (or cross-installation) manner (that's my case, unfortunately)rust
gitui
"if the editor command has no extension and we are on windows, then try with the extensions form that env var..."Aha, it appears that things are not that easy upstream...
https://github.com/rust-lang/rust/issues/37519
https://doc.rust-lang.org/src/std/process.rs.html#540-543
https://github.com/rust-lang/rust/pull/37381
... and all the way down the rabbit whole...
vs code is also not usable because of this. I have mine editor in git config:
git config -l|?{$_ -like '*edit*'}
core.editor=code --wait
and
gcm code
CommandType Name Version Source
----------- ---- ------- ------
Application code.cmd 0.0.0.0 C:\Program Files\Microsoft VS Code\bin\code.cmd
investigating this.
Thr std::Process code is really very broken, making all sorts of odd assumptions trying to make things work 'by magic'. I will file a bug but dont hold your breath.
I think I can come up with a solution - will update here
This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
what about vim bindings in gitui? do they exist and just not enabled by default? I mean like to move up/down (j/k). Otherwise I will gladly look into implementing this as a feature. Let me know please.
I am on Linux btw.
Thanks for
gitui
, it makes my daily life easier=)There is, however, one thing that seems break my current flow - I can not launch vim from within gitui.
Describe the bug Vim is not available as external editor
To Reproduce Steps to reproduce the behavior:
gitui
Same bug observed when trying to '^e'dit commit message in external editor.
Expected behavior A
vim
instance with selected file loaded.Context (please complete the following information):
WindowsTerminal
andpwsh-7.2.6
vim
andgitui
are installed viachocolatey
Additional context
vim
is present in path:and
git
is configured to usevim