From 2a80c502b50d1f9353821f2b5e13b64b190a0292 Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Date: Fri, 20 Aug 2021 08:08:15 -0300 Subject: [PATCH] zsh: fix config edit alias scripts path was hard coded, so if you were in a directory other than $HOME it would not work --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index f08a9dd..17d3e5f 100644 --- a/.zshrc +++ b/.zshrc @@ -31,7 +31,7 @@ zinit light zsh-users/zsh-completions alias config="git --git-dir=\$HOME/.dotfiles/ --work-tree=\$HOME" # 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' # Alias for python3