8000 add a "mcd" (menu change directory) command · Issue #2847 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

add a "mcd" (menu change directory) command #2847

@krader1961

Description

@krader1961

I've never liked the prevd/nextd model for navigating my cd history. And the pushd/popd model, while easier to reason about, is quite limiting. So long ago I wrote a mcd (menu change directory) function for ksh (Korn shell). When I switched to zsh a few years ago I ported that function. Now that I'm using fish full-time I decided it was time to write a fish version of mcd. I'm opening this issue to see if enough people think it is useful enough to be included in the standard fish package.

Below is the function. You can put this in ~/.config/fish/functions/mcd.fish to autoload it or put it in another file and explicitly source it. Here is an example of what it looks like:

screenshot 2016-03-22 18 47 19

Notice that this can also effectively replace the dirh command since, if you just press [enter] or [ctrl-D] at the prompt, it does nothing other than show you your recent cd history.

I've removed the first version of the function that was in my original post. It's been replaced by the updated version in the attachment below.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0