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() {

10
.zshrc
View file

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