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" echo_missing "rsync"
fi 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 # Set up Neovim aliases based on environment
if command_exists nvim; then if command_exists nvim; then
alias cnvim="command nvim" alias cnvim="command nvim"
alias nvim="$(choose_nvim)" alias nvim="$(choose_nvim)"
nv() { nv() {
NVIM_APPNAME="$1" command nvim "${@:2}" NVIM_APPNAME="$1" command nvim "${@:-2}"
} }
if [ -d "$HOME/.config/nvdev" ]; then if [ -d "$HOME/.config/nvdev" ]; then
@ -465,23 +481,6 @@ if command_exists termshark; then
alias ws="$_sudo termshark" alias ws="$_sudo termshark"
fi 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 # Tmux session manager
if command_exists tmux; then if command_exists tmux; then
ta() { ta() {

12
.zshrc
View file

@ -250,15 +250,13 @@ __end__() {
clear && clear &&
fastfetch fastfetch
else
echo_warning "fastfetch is not installed.."
fi fi
if command_exists cowsay; then if command_exists cowsay; then
alias clear='clear && cowsay -f tux "$(uptime --pretty)"' alias clear='clear && cowsay -f tux "$(uptime --pretty)"'
cowsay -f tux "$(uptime --pretty)" cowsay -f tux "$(uptime --pretty)"
else else
echo_warning "cowasy is not installed.." echo_missing "cowasy"
fi fi
__shell_qol__ __shell_qol__
@ -267,10 +265,14 @@ __end__() {
main() { main() {
__defaults__ __defaults__
__alias__
__sources__ __sources__
__end__ __end__
__keychain_setup__
if command_exists keychain; then
__keychain_setup__
else
echo_missing "keychain"
fi
} }
if check_root; then if check_root; then