interactive cd
This commit is contained in:
22
zsh/zshrc
22
zsh/zshrc
@@ -2,18 +2,20 @@
|
||||
|
||||
# path -> settings -> alias -> functions -> plugins -> prompt
|
||||
|
||||
if [ -n "${ZSH_VERSION}" ]; then
|
||||
_source="${(%):-%x}"
|
||||
_path=$(dirname "$(realpath "$_source")")
|
||||
unset _source
|
||||
else
|
||||
if [ ! -n "${ZSH_VERSION}" ]; then
|
||||
echo "Unsupported shell"
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
|
||||
# get the dir name that current file in
|
||||
function get_current_dir_name {
|
||||
_source="${(%):-%x}"
|
||||
_path=$(dirname "$(realpath "$_source")")
|
||||
echo $_path
|
||||
}
|
||||
|
||||
# Set basic path to zsh-polyjuice installation
|
||||
export ZSH_POLYJUICE_PATH="$_path"
|
||||
unset _path
|
||||
export ZSH_POLYJUICE_PATH=$(get_current_dir_name)
|
||||
export ZSH_PLUGINS_PATH="$ZSH_POLYJUICE_PATH/plugins"
|
||||
export ZSH_ALIAS_PATH="$ZSH_POLYJUICE_PATH/alias"
|
||||
export ZSH_SETTINGS_PATH="$ZSH_POLYJUICE_PATH/settings"
|
||||
@@ -51,10 +53,6 @@ source $ZSH_PLUGINS_PATH/ohmyzsh/plugins/zoxide/zoxide.plugin.zsh
|
||||
source $ZSH_PLUGINS_PATH/ohmyzsh/plugins/python/python.plugin.zsh
|
||||
|
||||
|
||||
function cdi() {
|
||||
cd $(find . -type d | fzf)
|
||||
}
|
||||
|
||||
# using starship as prompt
|
||||
if (( $+commands[starship] )); then
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
Reference in New Issue
Block a user