Skip to content

Commit

Permalink
fix zi prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
brightpuddle committed May 6, 2024
1 parent 31b0b85 commit 56a0bf9
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,34 @@ zinit ice wait"0" atclone'PYENV_ROOT="$PWD" ./libexec/pyenv init - > zpyenv.zsh'
zinit light pyenv/pyenv

zinit ice wait"0" as"command" from"gh-r" lucid \
atload'unalias zi' \
mv"zoxide -> zoxide" \
atclone"./zoxide init zsh > init.zsh" \
atpull"%atclone" src"init.zsh" nocompile'!'
zinit light ajeetdsouza/zoxide

source $HOME/.config/nnn/config
# eval $(opam env)
############################################################
# Functions
############################################################
# Yazi
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}
# Ctrl-P
fzf-open-file-or-dir() {
local cmd="command rg . --files --color=never"
local out=$(eval $cmd | fzf --exit-0 --height 40%)

if [ -f "$out" ]; then
vi "$out"
fi
}
zle -N fzf-open-file-or-dir
############################################################
# Aliases
############################################################
Expand Down Expand Up @@ -72,17 +93,6 @@ setopt hist_verify
# Fuzzy finder
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# Ctrl-P
fzf-open-file-or-dir() {
local cmd="command rg . --files --color=never"
local out=$(eval $cmd | fzf --exit-0 --height 40%)

if [ -f "$out" ]; then
vi "$out"
fi
}
zle -N fzf-open-file-or-dir

# Titles
function set-title-precmd() {
printf "\e]2;%s\a" "${PWD/#$HOME/~}"
Expand Down

0 comments on commit 56a0bf9

Please sign in to comment.