Re: cdgit: cd relative to git workdir root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



also sprach Thomas Koch <thomas@xxxxxxx> [2013.09.16.2101 +0200]:
> shell alias cdgit = cd $(git root)

I've tried to make this happen many years ago, but I never finished
the ZLE widget that did it. The idea was to bind 'tab' to a function
that would replace an occurrence of ~g in $LBUFFER with the output
of rev-parse--show-toplevel and then delegate to normal tab
expansion.

So now I just have

  hash -d g=$(git rev-parse --show-toplevel)

in a pre-prompt function and get the same effect.

  fishbowl:~/code/salt|develop|debian% ls ~g/debi<tab>

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"i am not in favour of long engagements. they give people the
 opportunity of finding out each other's character before marriage,
 which i think is never advisable."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@xxxxxxxxxxx

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]