Alias view to "vim -R" when available
We already alias "vi" to "vim" when the vim-enhanced package is installed. However, /usr/bin/view is a symlink to vi, which results in inconsistent behavior between the two - the "vi" command runs in vim mode, but the "view" command runs in vi mode. Alias "view" to "vim -R" when vim-enhanced is available so that these are consistent.
This commit is contained in:
parent
8939c5bdb1
commit
662d92a10a
1
vim.csh
1
vim.csh
@ -1,6 +1,7 @@
|
|||||||
if ( -x /usr/bin/id ) then
|
if ( -x /usr/bin/id ) then
|
||||||
if ( "`/usr/bin/id -u`" > 200 ) then
|
if ( "`/usr/bin/id -u`" > 200 ) then
|
||||||
alias vi vim
|
alias vi vim
|
||||||
|
alias view 'vim -R'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
1
vim.sh
1
vim.sh
@ -2,4 +2,5 @@ if [ -n "${BASH_VERSION-}" -o -n "${KSH_VERSION-}" -o -n "${ZSH_VERSION-}" ]; th
|
|||||||
[ "`/usr/bin/id -u 2>/dev/null || echo 0`" -le 200 ] && return
|
[ "`/usr/bin/id -u 2>/dev/null || echo 0`" -le 200 ] && return
|
||||||
# for bash and zsh, only if no alias is already set
|
# for bash and zsh, only if no alias is already set
|
||||||
alias vi >/dev/null 2>&1 || alias vi=vim
|
alias vi >/dev/null 2>&1 || alias vi=vim
|
||||||
|
alias view >/dev/null 2>&1 || alias view="vim -R"
|
||||||
fi
|
fi
|
||||||
|
5
vim.spec
5
vim.spec
@ -21,7 +21,7 @@ Summary: The VIM editor
|
|||||||
URL: http://www.vim.org/
|
URL: http://www.vim.org/
|
||||||
Name: vim
|
Name: vim
|
||||||
Version: %{baseversion}.%{patchlevel}
|
Version: %{baseversion}.%{patchlevel}
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: Vim and MIT
|
License: Vim and MIT
|
||||||
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
|
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
|
||||||
Source1: vim.sh
|
Source1: vim.sh
|
||||||
@ -775,6 +775,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
|
|||||||
%{_datadir}/icons/locolor/*/apps/*
|
%{_datadir}/icons/locolor/*/apps/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jul 31 2020 Zane Bitter <zbitter@redhat.com> - 2:8.2.1328-2
|
||||||
|
- Alias view to "vim -R" when available
|
||||||
|
|
||||||
* Fri Jul 31 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.1328-1
|
* Fri Jul 31 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.1328-1
|
||||||
- patchlevel 1328
|
- patchlevel 1328
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user