DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

fasd Notes


With fasd, you can not only jump to any folders once arrived (like what autojump do), but also open any files once opened.

Like what "Recent files" and "Recent folders" in Desktop Environment do, but in terminal.

Install and setup:

  1. Install fasd with sudo apt install fasd
  2. Add fasd in plugins=(...) in ~/zshrc
  3. Add alias o='fasd -a -e rifle' ~/.bash_aliases

The default definition of o is alias o='fasd -a -e xdg-open'. By changing it to rifle, you can define associated applications of different file types in ranger's configuration (~/.config/ranger/rifle.conf), which is more portable than customizing associations defined in xdg-open.

Now fasd will remember every file you open (with rifle or other command line application) and every directory, which can be listed with a (alas of fasd -a). Open a PDF file in any folder with o stat after running rf 'An Introduction to Statistical Learning-Trevor Hastie Robert Tibshirani(2015).pdf' in folder ~/Documents/Books. Here stat is a pattern in the opened file name, therefore remembered and matched by fasd, like fuzzy search with fzf.

Note: the aliases is defined in ~/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh. You can update it directly.



Published

Jan 21, 2021

Last Updated

Jan 25, 2021

Category

Tech

Tags

  • fasd 1
  • shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor