This commit is contained in:
Andrew R. M. 2024-05-13 13:55:38 -04:00
commit 4360067486
4 changed files with 38 additions and 14 deletions

View File

@ -1,7 +1,5 @@
#{- ~/.aliases -}# #{- ~/.aliases -}#
alias vim="nvim "
#{- FILE OPERATIONS -}# #{- FILE OPERATIONS -}#
# Allow alias expansion for commands executed with sudo # Allow alias expansion for commands executed with sudo
@ -40,6 +38,7 @@ alias df="df -h"
alias du="du -sh" alias du="du -sh"
# History searches # History searches
alias phistory='cat ${PERSISTENT_HISTFILE}'
alias hgrep='history | grep --color' alias hgrep='history | grep --color'
alias phgrep="cat ${PERSISTENT_HISTFILE} | grep --color" alias phgrep="cat ${PERSISTENT_HISTFILE} | grep --color"

View File

@ -2,13 +2,23 @@
#{- PROMPT -}# #{- PROMPT -}#
red="\001$(tput bold)$(tput setaf 1)\002" if which tput &> /dev/null && tput bold &> /dev/null; then
green="\001$(tput bold)$(tput setaf 2)\002" red="\001$(tput bold)$(tput setaf 1)\002"
yellow="\001$(tput bold)$(tput setaf 3)\002" green="\001$(tput bold)$(tput setaf 2)\002"
blue="\001$(tput bold)$(tput setaf 4)\002" yellow="\001$(tput bold)$(tput setaf 3)\002"
magenta="\001$(tput bold)$(tput setaf 5)\002" blue="\001$(tput bold)$(tput setaf 4)\002"
cyan="\001$(tput bold)$(tput setaf 6)\002" magenta="\001$(tput bold)$(tput setaf 5)\002"
no_color="\001$(tput sgr0)\002" cyan="\001$(tput bold)$(tput setaf 6)\002"
no_color="\001$(tput sgr0)\002"
else
red="\[\033[1;31m\]"
green="\[\033[1;32m\]"
yellow="\[\033[1;33m\]"
blue="\[\033[1;34m\]"
magenta="\[\033[1;35m\]"
cyan="\[\033[1;36m\]"
no_color="\[\033[0m\]"
fi
export PS1="${green}\$${no_color} " export PS1="${green}\$${no_color} "

View File

@ -21,3 +21,13 @@ cat_with_newline()
cat "$@" && echo cat "$@" && echo
} }
alias cat="cat_with_newline" alias cat="cat_with_newline"
vim_option_select()
{
if which nvim &> /dev/null; then
nvim "$@"
else
vim "$@"
fi
}
alias vim="vim_option_select "

View File

@ -1,14 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install my dotfiles on a variety of systems
echo "CURRENT LOCATION: $PWD" set -ex
echo "PWD: $PWD"
# Coder dotfiles (and most other ways of doing this) will not do a recursive clone, so do that in install script.
git submodule init && git submodule update
echo "Installing dotfiles..." echo "Installing dotfiles..."
if [ -f /etc/os-release ]; then if [ -f /etc/os-release ]; then
echo "Idenitfying OS to install GNU stow..." echo "Idenitfying OS to install GNU stow..."
if grep -q -i debian /etc/os-release; then if grep -q -i debian /etc/os-release; then
echo "You've got Debian!"; echo "You've got Debian!";
sudo apt update; sudo apt-get update;
sudo apt install -y stow; sudo apt-get install -y stow;
elif grep -q -i rhel /etc/os-release || grep -q -i fedora /etc/os-release; then 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!"; echo "You've got RedHat (or maybe Fedora)! Which is unsupported right now sorry!";
# sudo yum install -y stow; # sudo yum install -y stow;
@ -28,6 +33,6 @@ else
fi fi
# Apply the dotfiles with stow # Apply the dotfiles with stow
echo "RUNNING APPLY DOTFILES" echo "Running apply dotfiles"
./apply-dotfiles ./apply-dotfiles
echo "RAN APPLY DOTFILES" echo "Dotfiles applied successfully"