Switch to yazi and python imporovements

This commit is contained in:
Cameron Reed 2024-10-31 12:40:43 -06:00
parent b5ca587067
commit 0ccba725f6
2 changed files with 26 additions and 6 deletions

View File

@ -28,6 +28,9 @@ alias nv='nvim'
alias nvd='nvim .' alias nvd='nvim .'
alias nvc='nvim -c "edit \$MYVIMRC"' alias nvc='nvim -c "edit \$MYVIMRC"'
# D:
alias em='emacs'
alias c='clear' alias c='clear'
alias e='echo' alias e='echo'
@ -42,6 +45,9 @@ if command -v zigup &> /dev/null; then
alias zigup='zigup --install-dir "$HOME/.local/share/zigup" --path-link "$HOME/.local/bin/zig-local"' alias zigup='zigup --install-dir "$HOME/.local/share/zigup" --path-link "$HOME/.local/bin/zig-local"'
fi fi
bindkey -s '^o' 'lfcd\n' alias req='pip3 --require-virtualenv freeze > requirements.txt'
bindkey -s '^n' 'nvd\n'
bindkey -s '^o' 'yazicd\n'
bindkey -s '^n' 'nvd\n'
bindkey -s '^f' 'yazi\n'
bindkey -s '^e' 'xdg-open $(fzf)\n'

20
.zshrc
View File

@ -6,9 +6,6 @@
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
source $ZDOTDIR/.aliases
CACHE_DIR=${XDG_CACHE_HOME:-$HOME/.cache} CACHE_DIR=${XDG_CACHE_HOME:-$HOME/.cache}
STATE_DIR=${XDG_STATE_HOME:-$HOME/.local/state} STATE_DIR=${XDG_STATE_HOME:-$HOME/.local/state}
@ -146,6 +143,21 @@ function get_idf() {
alias idf="idf.py" alias idf="idf.py"
} }
function yazicd() {
file=$(mktemp)
yazi --cwd-file="$file" "$@"
cd $(cat "$file")
rm "$file"
}
function py() {
if [ "$#" -eq 0 ]; then
python3 -i -c 'def clear():print("\x1b[2J\x1b[H",end="")'
else
python3 "$@"
fi
}
# Initialize direnv if it exists # Initialize direnv if it exists
@ -160,3 +172,5 @@ fastfetch
unset CACHE_DIR unset CACHE_DIR
unset STATE_DIR unset STATE_DIR
source $ZDOTDIR/.aliases