This commit is contained in:
pika 2025-05-17 14:54:13 +02:00
parent 3340fdabd0
commit 54b201f720
2 changed files with 24 additions and 23 deletions

View file

@ -68,12 +68,28 @@ else
echo_missing "rsync"
fi
# ─< Function to determine which Neovim command to use >──────────────────────────────────
choose_nvim() {
if [ -n "$TMUX" ]; then
# If inside an active tmux session, use nvim
echo "command nvim"
return
elif [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then
# If in a graphical environment, use Neovide
if command_exists neovide; then
echo "neovide --fork"
return
fi
fi
# Default to nvim
echo "command nvim"
}
# Set up Neovim aliases based on environment
if command_exists nvim; then
alias cnvim="command nvim"
alias nvim="$(choose_nvim)"
nv() {
NVIM_APPNAME="$1" command nvim "${@:2}"
NVIM_APPNAME="$1" command nvim "${@:-2}"
}
if [ -d "$HOME/.config/nvdev" ]; then
@ -465,23 +481,6 @@ if command_exists termshark; then
alias ws="$_sudo termshark"
fi
# ─< Function to determine which Neovim command to use >──────────────────────────────────
choose_nvim() {
if [ -n "$TMUX" ]; then
# If inside an active tmux session, use nvim
echo "command nvim"
return
elif [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then
# If in a graphical environment, use Neovide
if command_exists neovide; then
echo "neovide --fork"
return
fi
fi
# Default to nvim
echo "command nvim"
}
# Tmux session manager
if command_exists tmux; then
ta() {