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 nvc='nvim -c "edit \$MYVIMRC"'
# D:
alias em='emacs'
alias c='clear'
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"'
fi
bindkey -s '^o' 'lfcd\n'
bindkey -s '^n' 'nvd\n'
alias req='pip3 --require-virtualenv freeze > requirements.txt'
bindkey -s '^o' 'yazicd\n'
bindkey -s '^n' 'nvd\n'
bindkey -s '^f' 'yazi\n'
bindkey -s '^e' 'xdg-open $(fzf)\n'

22
.zshrc
View File

@ -6,9 +6,6 @@
[[ $- != *i* ]] && return
source $ZDOTDIR/.aliases
CACHE_DIR=${XDG_CACHE_HOME:-$HOME/.cache}
STATE_DIR=${XDG_STATE_HOME:-$HOME/.local/state}
@ -103,7 +100,7 @@ function set_prompt() {
if [ -z "${SSH_CONNECTION}" ]; then
host=""
fi
PROMPT="[${prefix}${user}${host} %1~]%(#.#.$) "
}
@ -146,6 +143,21 @@ function get_idf() {
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
@ -160,3 +172,5 @@ fastfetch
unset CACHE_DIR
unset STATE_DIR
source $ZDOTDIR/.aliases