diff --git a/.aliases b/.aliases index 0f286e6..984ec1c 100644 --- a/.aliases +++ b/.aliases @@ -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' diff --git a/.zshrc b/.zshrc index 0019a04..c5b21d7 100644 --- a/.zshrc +++ b/.zshrc @@ -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