2

For some time, I am using autojump for navigation in my filesystem. It does pretty good job, but I would like it to be capable of opening files (in my favorite editor) -- fasd does this. Unfortunately, fasd doesn't have any commits for more than two years. I've also looked at fzf but there is no zsh completion.

Is there an actively developed project similar to fasd, fzf ot autojump these days? (with fasd feature set)

My question is related to this question.

Community
  • 1
  • 1
Tomas Tomecek
  • 6,226
  • 3
  • 30
  • 26

2 Answers2

0

That will look like publicity, (that kind of is), but a zsh plugin I develop could help you to do that.

It's not exactly the same way of working than fasd or autojump since you have to register and name your favorite directory. (this of course can be stored in a config file, and I am considering adding learning taking inspiration on fasd.)

One registered, you get both a variable to refer to the directory, and a dispatcher alias to jump to the directory, subdirectory, execute some commands and so forth and so on. Completion is supported for the subdirectory, and will add it soon for the editsubcommand.

If you want to give a look, here is the github repo and the readme, if you want to give a try, and have antigen just run antigen bundle AdrieanKhisbe/diractions

AdrieanKhisbe
  • 3,899
  • 8
  • 37
  • 45
0

Answered: https://stackoverflow.com/a/69686155/13658418 and https://stackoverflow.com/a/69685874/13658418

Add to ~/.zshrc:

fasd-fzf-cd-vi() {
   item="$(fasd -Rl "$1" | fzf -1 -0 --no-sort +m)"
  if [[ -d ${item} ]]; then
    cd "${item}" || return 1
  elif [[ -f ${item} ]]; then
    (vi "${item}" < /dev/tty) || return 1
  else
    return 1
  fi
   zle accept-line
}
zle -N fasd-fzf-cd-vi
bindkey '^e' fasd-fzf-cd-vi

Ctrl-E to search/navigate with fasd, fzf, vim and cd:

webdev4422
  • 113
  • 8