Giter Club home page Giter Club logo

Comments (8)

xiaq avatar xiaq commented on May 12, 2024

Yes.

I have always wanted such a feature, and I also know various others, e.g. fasd (inspired by your autojump). But I never find the CLI (as opposed to TUI) handy enough, and have never used one. Some thoughts:

  • It would be much much better if directory paths are automatically suggested to me, e.g. typing cd elv shows me cd ~/go/github.com/xiaq/elvish in some way. Compare this to the location bar of browsers.
  • A management command is still available, but most of the time the simple autosuggestion UI would be sufficient.
  • Elvish needs to have a permanent storage mechanism (#28) before this could be implemented.

from elvish.

joelthelion avatar joelthelion commented on May 12, 2024

Absolutely agree on all points :-)

from elvish.

jaredly avatar jaredly commented on May 12, 2024

OOoh yeah "awesomebar" for CLI would rock my world

from elvish.

xiaq avatar xiaq commented on May 12, 2024

@joelthelion I just pushed 7a50c04 which introduces two builtin functions that expose the directory history. I know the names are clumsy :) The user is supposed to define a handy alias themselves in the rc file, which unfortunately is not yet supported. The history is recorded by the cd builtin (which is probably a bad idea since there is no opt-out). The backend is found in store/visisted_dir.go.

There is no TUI yet, since I am focusing on the language at the moment. I'll do it when I switch my focus to the editor.

Suggestions and contributions are always welcome!

from elvish.

xiaq avatar xiaq commented on May 12, 2024

Some time in future I would like to move this feature out of the core into a (pure elvish) module. But that will only be possible when the editor becomes programmable enough, which is not the case currently.

from elvish.

xiaq avatar xiaq commented on May 12, 2024

The UI of the command-t plugin for vim is an excellent model for that of directory jumping. The directory jumping UI should work as follows:

  1. A hot key (Ctrl-T by default) triggers the directory jumping mode. This mode is characterized by a buffer under the normal line editor buffer (like a minibuffer, should the reader be familiar with the word). The line buffer is preserved and still shown.
  2. As the user types, matching directories in the history are automatically suggested using the command completion UI. Since the command completion UI is used, the keys for navigating among completion candidates (arrow keys and tab) are also available and the user may select a directory other than the first one.
  3. Hitting Enter leaves the directory jumping mode and causes elvish to cd there. Hitting Ctrl-C (or maybe also Esc) leaves the mode without jumping.

An open question: how should the key bindings in this mode relate to those in the insert mode, vi-normal mode and completion mode? Specifically, when the user enters this mode from vi-normal mode, should line editing in the minibuffer use vi-normal key bindings?

from elvish.

xiaq avatar xiaq commented on May 12, 2024

I am also considering using Ctrl-L for the trigger key by analogy to browsers.

from elvish.

xiaq avatar xiaq commented on May 12, 2024

@joelthelion The UI for directory jumping has landed. I find it pretty cool :)

from elvish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.