LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Command-line productivity: fasd (https://www.linuxquestions.org/questions/slackware-14/command-line-productivity-fasd-4175600098/)

drgibbon 02-18-2017 07:39 PM

Command-line productivity: fasd
 
I have recently been trying out bash-it (something like oh-my-zsh for bash), and I stumbled upon fasd (which bash-it has a plugin for). It is for accessing recent files and directories (based on Mozilla's frecency algorithm). I've found it really useful, even with only a few commands. The four basic ones are: f(iles), a(ll), s(elect), d(irectories).

f, a, and d start search commands, and if you prefix with s then you can select from a list. There is also z, which jumps directly into a directory. So;

Code:

# pwd
/home/user
# z sferic
# pwd
~/media/music/Shackleton & Vengeance Tenfold/Sferic Ghost Transmits

fasd becomes particularly useful with aliases, for example;
Code:

alias e='f -i -e "emacs -nw"'
This will interactively open a recently accessed file with emacs. So, say I want to edit my awesomewm config file (which is ~/.config/awesome/rc.lua), from any directory I could just do;
Code:

e rclua
and it opens up. If it was an ambiguous search, then the -i flag in the alias makes it present a selection list;
Code:

# e rc

5        2          /home/user/.mbsyncrc
4        4          /etc/rc.d/rc.firewall
3        6.48966    /home/user/.weechat/irc.conf
2        28.7322    /home/user/.bashrc
1        39.4607    /home/user/.config/awesome/rc.lua
>

and you choose the index number to open that file. There's a lot more than can be done, but I find just these little things very handy. There's more info on the fasd page, and its also on SBo.

NoStressHQ 02-20-2017 10:16 AM

I'd like to vote as "useful", but I can't because it's the OM :). So thank you for the hints !

Cheers !

Garry.

dugan 02-20-2017 01:19 PM

I use FISH. I see that there are ports to both oh-my-fish and fisherman.

As for adding FISH support to the actual project: I'm thinking about it, but the fact that they didn't look at the work I did to fix their tcsh support makes me reluctant to help them any more.

https://github.com/clvv/fasd/pull/106

syg00 02-20-2017 04:25 PM

Quote:

Originally Posted by NoStressHQ (Post 5673547)
I'd like to vote as "useful", but I can't because it's the OM :). So thank you for the hints !

You can click the "rep" (small) link on the left - and add a (non-public) comment if you wish.

NoStressHQ 02-20-2017 09:11 PM

Quote:

Originally Posted by syg00 (Post 5673778)
You can click the "rep" (small) link on the left - and add a (non-public) comment if you wish.

Thank you !


All times are GMT -5. The time now is 09:38 AM.