From 3636fb6d0750214d68fec362f36ed7fbbcdf7f31 Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Sat, 5 Apr 2025 16:37:09 -0400 Subject: [PATCH] Add a vim option select --- bash/.aliases | 3 +-- bash/.functions | 10 ++++++++++ install.sh | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bash/.aliases b/bash/.aliases index 71ca0be..c1b6a99 100644 --- a/bash/.aliases +++ b/bash/.aliases @@ -1,7 +1,5 @@ #{- ~/.aliases -}# -alias vim="nvim " - #{- FILE OPERATIONS -}# # Allow alias expansion for commands executed with sudo @@ -40,6 +38,7 @@ alias df="df -h" alias du="du -sh" # History searches +alias phistory='cat ${PERSISTENT_HISTFILE}' alias hgrep='history | grep --color' alias phgrep="cat ${PERSISTENT_HISTFILE} | grep --color" diff --git a/bash/.functions b/bash/.functions index 41c5043..c412f00 100644 --- a/bash/.functions +++ b/bash/.functions @@ -21,3 +21,13 @@ cat_with_newline() cat "$@" && echo } alias cat="cat_with_newline" + +vim_option_select() +{ + if which nvim &> /dev/null; then + nvim "$@" + else + vim "$@" + fi +} +alias vim="vim_option_select " diff --git a/install.sh b/install.sh index d4d8483..15c7aae 100755 --- a/install.sh +++ b/install.sh @@ -7,8 +7,8 @@ if [ -f /etc/os-release ]; then echo "Idenitfying OS to install GNU stow..." if grep -q -i debian /etc/os-release; then echo "You've got Debian!"; - sudo apt update; - sudo apt install -y stow; + sudo apt-get update; + sudo apt-get install -y stow; elif grep -q -i rhel /etc/os-release || grep -q -i fedora /etc/os-release; then echo "You've got RedHat (or maybe Fedora)! Which is unsupported right now sorry!"; # sudo yum install -y stow;