You might want to check out z: https://github.com/rupa/z
https://github.com/clvv/fasd I used to use z, but I've since switched to fasd. It's much like z, but also so much better. In addition to being able to do "z " you can do "f ". So, for example, if I've got a rails project I've worked on a lot recently I know its config.ru is high on frecency, so I'll just do "vim `f config`" to edit that file. If I want a file that's not so recent I can always do "vim `f -i config`" t…
Quickly navigate your filesystem from the command line
81–90 of 148 posts
Re: Quickly navigate your filesystem from the command line
#82Re: Quickly navigate your filesystem from the command line
#83* Autojump automatically saves marks,
~~~ cd Downloads # And you are done. ~~~
* You don't have to think about mark names,
~~~ cd Projects/Python # It will be called `python`. ~~~
* You don't need to remember mark names,
~~~ j haskell # If you want `Projects/Haskell`, odds are the mark is auto-named `haskell`. ~~~
* You can specify only some part of mark name;
~~~ j bar # And you are in `Stuff/foobar`. ~~~
Other than that, this is, as I said before, great! Looking forward to go through the source code to learn more about Bash.
Re: Quickly navigate your filesystem from the command line
#84I also do something similar but slightly different: https://github.com/roobert/dotfiles/blob/master/.zsh/robs/fu... my method involves storing the bookmarks in a file but loading them into zshs directory hash. This means the directories are tab completable and if you have AUTO_CD set then you can change directory with simply: ~dir_name, otherwise: cd ~dir_name.
And with CDABLE_VARS set, you can simply do: dir_name In fact, you don't even have to use the directory hash for this, you just do, e.g.: MY_DIR=/path/to/dir; MY_DIR Frankly, this is far superior to the linked method.
Re: Quickly navigate your filesystem from the command line
#85I set my version up with a -f on the unmark rm so that I don't need to be prompted to remove it. Also added some basic completion for both jump and unmark export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" } function mark { mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 } function unmark { rm -if $MARKPATH/$1 } function marks { ls -l $MARKPATH | sed 's/ / /g' | cut -…
Try removing the -i option to obtain what you want.
Re: Quickly navigate your filesystem from the command line
#86I had to modify Jeroen's code to get the `marks` shortcut working under Mac OS 10.8: export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2> /dev/null || echo "No such mark: $1" } function mark { mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 } function unmark { rm -i $MARKPATH/$1 } function marks { ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- && echo }
function mark {
mkdir -p $MARKPATH; ln -s "$(pwd)" $MARKPATH/$1
}
Disclaimer: I'm not very good at bash, perhaps there is a nicer solution to this problem?Re: Quickly navigate your filesystem from the command line
#87Reminds me of z, which I use all the time. Anyone else use z? If you have not heard of it, get it now https://github.com/rupa/z . z is a wonderful complement to cd. After cd into a folders with z set up, a file stores all folders navigated to sorted by frecency, then simply jump to a folder with z [foldernameregex].
z is absolutely wonderful. Even my boss has become a convert, and he's been hacking unix since the 1970s, when he worked at AT&T, and is very set in his ways. [Disclaimer: rupa's a good friend of mine]
[Disclaimer: rupa is a good friend of mine, as well]
Re: Quickly navigate your filesystem from the command line
#88 function mark {
mkdir -p $MARKPATH; ln -s "$(pwd)" $MARKPATH/$1
}Re: Quickly navigate your filesystem from the command line
#89 setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
Which automatically pushes (unique) directories I've visted into $dirstack.Then I have an alias:
d () {
local dir
select dir in $dirstack
echo $dir
break
done
test "x$dir" != x && cd $dir
}
That gives me a list of directories to jump to in my history: ~/src/git/emacs-prelude $ d
1) /home/kelvie/tmp/typhoon 3) /home/kelvie/src/git
2) /home/kelvie/tmp 4) /home/kelvie
?#
So I just type 1-4 to go back to a directory I've previously been in.Re: Quickly navigate your filesystem from the command line
#90Here is a fully functional (albeit minimal) Windows version: http://appleseedhq.net/stuff/marks-v1.zip . Tested on Windows 7 (does not require PowerShell). GitHub: https://github.com/dictoon/marks Edit: to install, unzip anywhere and add to your path. Then: C:\Windows> mark win C:\Windows> marks win => C:\Windows C:\Windows> cd .. C:\> jump win C:\Windows> Marks will be stored in a marks\ subdirectory (relatively to…