Update PROJECT_NAME on cd
This commit is contained in:
parent
b7e826b392
commit
9fb4d582ce
@ -1,12 +1,12 @@
|
||||
# gh
|
||||
if (( $+commands[gh] )); then
|
||||
gh_chpwd_hook() {
|
||||
_gh_chpwd_hook() {
|
||||
if [[ -d ".github" ]]; then
|
||||
PAGER= gh pr list
|
||||
fi
|
||||
}
|
||||
|
||||
chpwd_functions+=( gh_chpwd_hook )
|
||||
chpwd_functions+=( _gh_chpwd_hook )
|
||||
|
||||
gh_chpwd_hook
|
||||
_gh_chpwd_hook
|
||||
fi
|
||||
|
@ -1,12 +1,12 @@
|
||||
# git
|
||||
if (( $+commands[git] )); then
|
||||
git_chpwd_hook() {
|
||||
_git_chpwd_hook() {
|
||||
if [[ -d ".git" ]]; then
|
||||
git status
|
||||
fi
|
||||
}
|
||||
|
||||
chpwd_functions+=( git_chpwd_hook )
|
||||
chpwd_functions+=( _git_chpwd_hook )
|
||||
|
||||
git_chpwd_hook
|
||||
_git_chpwd_hook
|
||||
fi
|
||||
|
7
zsh.d/project_name.zsh
Normal file
7
zsh.d/project_name.zsh
Normal file
@ -0,0 +1,7 @@
|
||||
_project_name_chpwd_hook() {
|
||||
export PROJECT_NAME="${PWD##*/}"
|
||||
}
|
||||
|
||||
chpwd_functions+=( _project_name_chpwd_hook )
|
||||
|
||||
_project_name_chpwd_hook
|
@ -8,7 +8,6 @@ export HELIX_RUNTIME="$HOME/src/helix/runtime"
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
export SKIM_DEFAULT_COMMAND="git ls-tree -r --name-only HEAD || rg --files"
|
||||
export VISUAL="helix"
|
||||
export PROJECT_NAME="${PWD##*/}"
|
||||
|
||||
fpath+=(~/.zsh/completions)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user