shell: add and source plugins
Currently only zoxide
This commit is contained in:
parent
bda5105914
commit
80ecba5396
2 changed files with 19 additions and 0 deletions
15
.config/shell/plugins
Normal file
15
.config/shell/plugins
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
# shell plugins for POSIX
|
||||
|
||||
# Enable zoxide if it exists
|
||||
if command zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then
|
||||
# Check what shell we're using based on variables that get set by non-posix shells - https://stackoverflow.com/a/3327022
|
||||
if [ -n "${ZSH_NAME+set}" ]; then # zsh
|
||||
eval "$(zoxide init zsh)"
|
||||
elif [ -n "${BASH+set}" ]; then # bash
|
||||
eval "$(zoxide init bash)"
|
||||
else
|
||||
# assume posix
|
||||
eval "$(zoxide init posix --hook prompt)"
|
||||
fi
|
||||
fi
|
|
@ -82,6 +82,10 @@ ${SKIP_FUNCTIONS:-false} || fnupdate
|
|||
### Options >>>
|
||||
set -o vi
|
||||
|
||||
# <<<
|
||||
### "Plugins" >>>
|
||||
${SKIP_SH_PLUGINS:-false} || careful_source "$SHELL_CONFIG_DIR/plugins"
|
||||
|
||||
# <<<
|
||||
|
||||
# <<<
|
||||
|
|
Loading…
Add table
Reference in a new issue