From 54b201f7209b043f45a42a05cd20beb34ffb76a0 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 17 May 2025 14:54:13 +0200 Subject: [PATCH] fixes --- .zsh/.aliases.zsh | 35 +++++++++++++++++------------------ .zshrc | 12 +++++++----- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.zsh/.aliases.zsh b/.zsh/.aliases.zsh index b509f7c..ffe8297 100644 --- a/.zsh/.aliases.zsh +++ b/.zsh/.aliases.zsh @@ -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() { diff --git a/.zshrc b/.zshrc index 8362b74..6b0c52e 100644 --- a/.zshrc +++ b/.zshrc @@ -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__ - __keychain_setup__ + + if command_exists keychain; then + __keychain_setup__ + else + echo_missing "keychain" + fi } if check_root; then