mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-12-23 03:02:53 +01:00
nvim: add fallback for vim and vi
This commit is contained in:
parent
9504420f55
commit
9e738b9820
1
bash/usr-local-bin/.gitignore
vendored
1
bash/usr-local-bin/.gitignore
vendored
@ -8,3 +8,4 @@ joplin
|
|||||||
ff
|
ff
|
||||||
chrome
|
chrome
|
||||||
iwd-wifi.bash
|
iwd-wifi.bash
|
||||||
|
vim
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# In case we are on SteamOS?
|
# In case we are on SteamOS?
|
||||||
#set -x
|
set -x
|
||||||
# The usual system-wide installation
|
# The usual system-wide installation
|
||||||
if [ -f /usr/bin/nvim ]; then
|
if [ -f /usr/bin/nvim ]; then
|
||||||
/usr/bin/nvim "$@"
|
/usr/bin/nvim "$@"
|
||||||
@ -10,9 +10,22 @@ elif [ -f /var/lib/flatpak/exports/bin/io.neovim.nvim ]; then
|
|||||||
# User-specific flatpak
|
# User-specific flatpak
|
||||||
elif [ -f ~/.local/share/flatpak/exports/bin/io.neovim.nvim ]; then
|
elif [ -f ~/.local/share/flatpak/exports/bin/io.neovim.nvim ]; then
|
||||||
flatpak run --user io.neovim.nvim "$@"
|
flatpak run --user io.neovim.nvim "$@"
|
||||||
|
# Snap
|
||||||
|
elif [ -f /snap/bin/nvim ]; then
|
||||||
|
snap run nvim "$@"
|
||||||
|
# Fallback to vim, because this script breaks my alias/function
|
||||||
|
elif [ -f /usr/bin/vim ]; then
|
||||||
|
/usr/bin/vim "$@"
|
||||||
|
elif [ -f /var/lib/flatpak/exports/bin/org.vim.Vim ]; then
|
||||||
|
flatpak run org.vim.Vim "$@"
|
||||||
|
elif [ -f ~/.local/share/flatpak/exports/bin/org.vim.Vim ]; then
|
||||||
|
flatpak run --user org.vim.Vim "$@"
|
||||||
|
# Fallback to Vi is acceptable.
|
||||||
|
elif [ -f /usr/bin/vi ]; then
|
||||||
|
/usr/bin/vi "$@"
|
||||||
# If not found.
|
# If not found.
|
||||||
else
|
else
|
||||||
printf "nvim doesn't seem to be installed :("
|
printf "Neither nvim or vim found :("
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
#set +x
|
#set +x
|
||||||
|
1
bash/usr-local-bin/vim
Symbolic link
1
bash/usr-local-bin/vim
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
nvim
|
Loading…
Reference in New Issue
Block a user