emacs-style partial directory path completion in bash

1

In emacs, when entering a file path, I can do something like:

~/c/s/h/npu2-o.c<TAB>

and have it expand to

~/code/skiboot/hw/npu2-opencapi.c

Is there any way to get similar path expansion in bash?

ajd

Posted 2017-05-30T05:12:06.773

Reputation: 113

Answers

1

Don't know about bash, but at least Zsh can do that. I haven't touched my Zsh completion config in a long while, so I'm not sure which part does that, but I think it's just compinit. IIRC you can just run the compinstall command in Zsh and that will setup the completion config for you.

Stefan

Posted 2017-05-30T05:12:06.773

Reputation: 1 052

-1

Disclosure: I am the author of the project

This project enables the desired completion in bash: https://github.com/sio/bash-complete-partial-path

Hope you'll find it useful

SIO

Posted 2017-05-30T05:12:06.773

Reputation: 149