some addet plugins
This commit is contained in:
parent
cb53b11b5d
commit
36c204690d
3 changed files with 214 additions and 11 deletions
41
.bashrc
41
.bashrc
|
@ -20,6 +20,12 @@ function echo_info() {
|
|||
echo_messages+=("$message")
|
||||
}
|
||||
|
||||
function echo_plugin() {
|
||||
local message="\033[0;1;35mℹ️ Bash Plugin:\033[0;35m\t${*} loaded\033[0m"
|
||||
echo -e "$message"
|
||||
echo_messages+=("$message")
|
||||
}
|
||||
|
||||
# Function to print all stored messages
|
||||
function print_echo_messages() {
|
||||
echo -e "\033[38;5;196mL\033[38;5;202mo\033[38;5;208mg\033[38;5;214m \033[38;5;220mo\033[38;5;226mu\033[38;5;118mt\033[38;5;46mp\033[38;5;48mu\033[38;5;51mt\033[38;5;45m:"
|
||||
|
@ -28,11 +34,6 @@ function print_echo_messages() {
|
|||
done
|
||||
}
|
||||
|
||||
# ─< check if command exists >────────────────────────────────────────────────────────────
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# ─< Silent execution >─────────────────────────────────────────────────────────────────
|
||||
silentexec() {
|
||||
"$@" >/dev/null 2>&1
|
||||
|
@ -183,11 +184,6 @@ _init() {
|
|||
*) ;;
|
||||
esac
|
||||
|
||||
# ─< ssh completions >────────────────────────────────────────────────────────────────────
|
||||
if [ -f "$HOME/.bash/ssh" ]; then
|
||||
. "$HOME/.bash/ssh"
|
||||
fi
|
||||
|
||||
# ─< zoxide >─────────────────────────────────────────────────────────────────────────────
|
||||
if command_exists zoxide; then
|
||||
eval "$(zoxide init bash)"
|
||||
|
@ -206,11 +202,34 @@ _init() {
|
|||
curl -s https://ohmyposh.dev/install.sh | $_sudo bash -s -- -d /usr/bin/
|
||||
fi
|
||||
fi
|
||||
|
||||
local bash_dir="$HOME/.bash/plugins"
|
||||
if [ -d "$bash_dir" ]; then
|
||||
echo_info "Plugins will be loadet.."
|
||||
|
||||
# ─< plugins to configure (usually just the filename in the plugins list) >───────────────
|
||||
local plugAutopairs="autopairs.sh"
|
||||
local sshCompletion="ssh"
|
||||
|
||||
# ─< active plugins >─────────────────────────────────────────────────────────────────────
|
||||
plugins=(
|
||||
"$plugAutopairs"
|
||||
"$sshCompletion"
|
||||
)
|
||||
|
||||
# ─< loop through and source the plugins >────────────────────────────────────────────────
|
||||
for plugin in "${plugins[@]}"; do
|
||||
if [ -f "$plugin" ]; then
|
||||
echo_plugin "$plugin"
|
||||
. "$plugin"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
_alias() {
|
||||
# ─< set keybinding mode >────────────────────────────────────────────────────────────────
|
||||
# set -o emacs
|
||||
set -o emacs
|
||||
# set -o vim
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue