autojump
autojump copied to clipboard
Running autojump on Windows with Clink
Hi! Autojump is installed and working, except it is not adding directories when I navigate around using "cd". I've added a couple of directories manually with "autojump --add C:..", and that helps me tremendously, but it would be amazing if "cd" automatically added directories.
Maybe I missed something while installing?
@mdlawson is the best contact for Windows / Clink questions. I don't have a Windows box. :/
Same as @hcsaustrup Out of the box, cd does not add entries but running the -add manually does work.
So, this is what I've come up with so far:
doskey cd=cd $1 $T autojump -a ^%CD^%\$1
This will alias the cd
command to add the directory to autojump. Unfortunately, %CD%
isn't updated until after the command is ran, so you have to append the first argument :disappointed: That means it wouldn't work if you did cd %temp%
or something like that.
FYI you can add that to your <cmdr dir>/config/aliases
file. In that case, you'd omit the ^
characters and just add the line:
cd=cd $*$Tautojump -a %CD%\$1
I've updated this to actually be
cd=cd $*$Tautojump -i >nul
This way it also updates the weights and I do not have to do anything fancy with adding manually.
One more update to the above...if you don't want it to echo the directory and weight, then you have to use $G to redirect in a macro:
doskey cd=cd $*$Tautojump -i $Gnul
A minor annoyance in that alias is extra empty line that is printed with cd
.
Hi guys i am also having the same issue, @frizzr where would i add doskey cd=cd $*$Tautojump -i $Gnul
. Or do i have to execute each time i open a shell
Hi guys i am also having the same issue, @frizzr where would i add
doskey cd=cd $*$Tautojump -i $Gnul
. Or do i have to execute each time i open a shell
Earlier there was a mention that a setup script could be run with Windows terminal emulators like Cmder but absent that, I would look at this superuser answer for how to run setup commands like this with the bog-standard command prompt:
https://superuser.com/questions/144347/is-there-windows-equivalent-to-the-bashrc-file-in-linux