public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/vim] f43: fix: handle symlinked paths in vi alias profiles
@ 2026-11-23 15:18 Thien Trung Vuong
0 siblings, 0 replies; only message in thread
From: Thien Trung Vuong @ 2026-11-23 15:18 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/vim
Branch : f43
Commit : 977dbf7eb295408c66a2bd1b48f08c237b55a693
Author : Thien Trung Vuong <tvuong@microsoft.com>
Date : 2026-11-20T14:28:31-07:00
Stats : +2/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/vim/c/977dbf7eb295408c66a2bd1b48f08c237b55a693?branch=f43
Log:
fix: handle symlinked paths in vi alias profiles
When /usr/sbin is a symlink to /usr/bin and precedes it in PATH,
`command -v` reports /usr/sbin/vi and /usr/sbin/vim. The literal
/usr/bin comparison prevents the alias from being defined even though
both commands resolve to the expected executables.
Add an explicit check for /usr/sbin/vi and /usr/sbin/vim before creating
an alias.
Signed-off-by: Thien Trung Vuong <tvuong@microsoft.com>
---
diff --git a/vim.fish b/vim.fish
index b0b037d..16ae1e8 100644
--- a/vim.fish
+++ b/vim.fish
@@ -4,7 +4,7 @@ set vim_cond (command -v vim)
set vi_cond (command -v vi)
switch "$vim_cond-$vi_cond"
- case /usr/bin/vim-/usr/bin/vi
+ case /usr/bin/vim-/usr/bin/vi /usr/sbin/vim-/usr/sbin/vi
# apply only if founded vim and vi are in the expected dir from distro
function vi
command vim $argv
diff --git a/vim.sh b/vim.sh
index 3bec722..52ae4dc 100644
--- a/vim.sh
+++ b/vim.sh
@@ -1,7 +1,7 @@
if [ -n "${BASH_VERSION-}" -o -n "${KSH_VERSION-}" -o -n "${ZSH_VERSION-}" ]; then
# This will avoid user defined aliases and possibly stuff defined earlier in the PATH.
case "$(command -v vim)-$(command -v vi)" in
- /usr/bin/vim-/usr/bin/vi)
+ /usr/bin/vim-/usr/bin/vi|/usr/sbin/vim-/usr/sbin/vi)
# apply only when founded vim and vi are in expected dirs from distro
alias vi=vim
;;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 15:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 15:18 [rpms/vim] f43: fix: handle symlinked paths in vi alias profiles Thien Trung Vuong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox