zsh: fix config edit alias

scripts path was hard coded, so if you were in a directory other
than $HOME it would not work
This commit is contained in:
Guilherme Rugai Freire 2021-08-20 08:08:15 -03:00
parent 2cc3655493
commit 2a80c502b5
No known key found for this signature in database
GPG Key ID: 0F9FE41723A8A297

2
.zshrc
View File

@ -31,7 +31,7 @@ zinit light zsh-users/zsh-completions
alias config="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME" alias config="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME"
# Config/scripts Edit # Config/scripts Edit
alias ce="echo \"\$(/bin/ls \$HOME/.scripts/bin | sed 's|^|.scripts/bin/|')\n\$(config ls-tree -r master --name-only \$HOME)\" | fzf --info=inline --prompt='Select a file: ' --preview='bat --paging=never --style=plain --color=always {}' | xargs -r \$EDITOR" alias ce="echo \"\$(/bin/ls \$HOME/.scripts/bin | sed \"s|^|\$(realpath \$HOME/.scripts/bin/ --relative-to=.)/|\")\n\$(config ls-tree -r master --name-only \$HOME)\" | fzf --info=inline --prompt='Select a file: ' --preview='bat --paging=never --style=plain --color=always {}' | xargs -r \$EDITOR"
bindkey -s '^e' 'ce\n' bindkey -s '^e' 'ce\n'
# Alias for python3 # Alias for python3