This plugin for ranger adds complete support for autojump to ranger:
Whenever a new directory is opened in ranger, autojump is notified and can change the weights accordingly.
Using :j
you can use autojump to jump to a directory. This is made even better by adding map cj console j%space
to your rc.conf
. Thus typing cj dirname
will let you jump to dirname.
As an added bonus, there is a zsh plugin introducing a new function called r
. Without arguments, it just opens ranger. If you supply an argument that is a directory, ranger is opened in that directory. But if you supply anything else as an argument, autojump
is called with the argument and ranger
is opened there 🧙
If you want similar functionality for zoxide, you can try ranger-zoxide.
As autojump seems to be unmaintained and there's not really any features missing, this repo exists as-is. I will still look at PRs and issues, but don't expect too much.
If you want similar functionality for zoxide, you can try ranger-zoxide.
- Copy
autojump.py
to${XDG_CONFIG_HOME}/ranger/plugins
. - Add the following mapping to your
rc.conf
for convenience:map cj console j%space
- To use autojump with vim, the autojump.vim plugin can be installed. This can also be integrated with ZSH as shown below.
- Install the zsh plugin using your favorite plugin manager, e.g.:
- zgenom:
zgenom load fdw/ranger_autojump
- antigen:
antigen bundle fdw/ranger_autojump@main
- oh-my-zsh:
- Clone this repository into oh-my-zsh's plugin directory:
git clone https://github.com/fdw/ranger-autojump ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ranger-autojump
- Activate the plugin in
~/.zshrc
:plugins=( [plugins...] ranger-autojump)
- Clone this repository into oh-my-zsh's plugin directory:
- zgenom:
- (Optional) For vim integration add the following convenience function to your .zshrc:
function jvim { file="$(AUTOJUMP_DATA_DIR=~/.autojump.vim/global autojump $@)"; if [ -n "$file" ]; then vim "$file"; fi }