Augments functions to achieve more expected behavior
This commit is contained in:
parent
b28331b896
commit
6021ad3194
2 changed files with 9 additions and 2 deletions
|
@ -51,7 +51,7 @@ function wgcheckout {
|
|||
|
||||
# wgcheckout combined with a fuzzy search
|
||||
function wgfcheckout {
|
||||
branchname=$(git branch | fzf)
|
||||
branchname=$(trim $(git branch | fzf))
|
||||
|
||||
[ ! -z "$branchname" ] && wgcheckout "$branchname" || return
|
||||
}
|
||||
|
|
|
@ -22,7 +22,14 @@ function wfd {
|
|||
|
||||
# pushd into a directory on your dirs stack
|
||||
function wpushd {
|
||||
dir=$(dirs | tr ' ' '\n' | fzf | dirname) && pushd "$dir"
|
||||
dir="$(dirs | tr ' ' '\n' | fzf)" && pushd "$dir"
|
||||
}
|
||||
|
||||
|
||||
# trims leading and trailing whitespace
|
||||
function trim {
|
||||
input="$1"
|
||||
|
||||
echo "${input//[[:blank:]]/}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue