major restructuring for using snowfall
This commit is contained in:
6
non-nix/zsh/custom-plugins/fzf-z.zsh
Normal file
6
non-nix/zsh/custom-plugins/fzf-z.zsh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/zsh
|
||||
|
||||
fzf-z() {
|
||||
dir=$(z | fzf --tiebreak=index --tac | sed -E 's/^[0-9]+[[:space:]]+//')
|
||||
cd $dir
|
||||
}
|
21
non-nix/zsh/custom-plugins/last-working-dir.zsh
Normal file
21
non-nix/zsh/custom-plugins/last-working-dir.zsh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/zsh
|
||||
#
|
||||
# My version of the last-working-dir plugin (https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/last-working-dir/last-working-dir.plugin.zsh)
|
||||
#
|
||||
# Updates the last directory once directory is changed
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd chpwd_last_working_dir
|
||||
chpwd_last_working_dir() {
|
||||
# Don't run in subshells
|
||||
[[ "$ZSH_SUBSHELL" -eq 0 ]] || return 0
|
||||
pwd > ~/.last-working-dir
|
||||
}
|
||||
|
||||
# Changes directory to the last working directory
|
||||
lwd() {
|
||||
if [[ -r ~/.last-working-dir ]]; then
|
||||
lwd=$(cat ~/.last-working-dir)
|
||||
cd $lwd
|
||||
echo $lwd
|
||||
fi
|
||||
}
|
Reference in New Issue
Block a user