Browse Source

.sh_common: add extra quoting to h, b, ct, mcd

...after writing this comment describing things:

https://lobste.rs/s/nsfdaw/improving_shell_workflows_with_fzf#c_b1puho
main
Brennen Bearnes 6 months ago
parent
commit
f24d171de9
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      home/.sh_common

+ 6
- 6
home/.sh_common View File

@ -98,7 +98,7 @@ function p {
}
function ct {
cd $(todaydir)
cd "$(todaydir)"
}
if type exa &> /dev/null; then
@ -164,23 +164,23 @@ fi
# See: https://p1k3.com/2016/5/17/
function h {
if [ ! -z "$@" ]; then
cd $(tail -2500 ~/.directory_history | tac | unsorted-unique | fzf --no-sort --height=50% -q $@)
cd "$(tail -2500 ~/.directory_history | tac | unsorted-unique | fzf --no-sort --height=50% -q $@)"
else
cd $(tail -2500 ~/.directory_history | tac | unsorted-unique | fzf --no-sort --height=50%)
cd "$(tail -2500 ~/.directory_history | tac | unsorted-unique | fzf --no-sort --height=50%)"
fi
}
function b {
if [ ! -z "$@" ]; then
echo $(realpath "$@") >> ~/.directory_bookmarks
echo "$(realpath "$@")" >> ~/.directory_bookmarks
else
cd $(sort ~/.directory_bookmarks | uniq | fzf --no-sort --height=50%)
cd "$(sort ~/.directory_bookmarks | uniq | fzf --no-sort --height=50%)"
fi
}
# Create a directory (if it doesn't exist) and cd to it:
function mcd {
mkdir -p $1 && cd $1
mkdir -p "$1" && cd "$1"
}
# Use official git prompt, if it exists, or fall back to


Loading…
Cancel
Save