Comments (8)
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 mecd ~/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.
Absolutely agree on all points :-)
from elvish.
OOoh yeah "awesomebar" for CLI would rock my world
from elvish.
@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.
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.
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:
- 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. - 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.
- Hitting Enter leaves the directory jumping mode and causes elvish to
cd
there. HittingCtrl-C
(or maybe alsoEsc
) 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.
I am also considering using Ctrl-L
for the trigger key by analogy to browsers.
from elvish.
@joelthelion The UI for directory jumping has landed. I find it pretty cool :)
from elvish.
Related Issues (20)
- Add external command callbacks HOT 2
- public versus private module functions HOT 1
- Document the exception behaviour of defer
- Feature Request: Inotify module HOT 4
- use edit breaks the edit namespace HOT 1
- Efficiently prepending to a list HOT 5
- Better integration with programs in other languages HOT 5
- Path completion works for var but not set
- Unicode hourglass is rendered with wrong char width HOT 4
- How to use `os.exists`? HOT 2
- `use` creates a namespace even when no module was loaded HOT 7
- Execute command line on Windows and dll in the same path HOT 2
- Support Shebang? HOT 3
- completion after wildcard character
- treat '#' as a bareword if it's after non-whitespace character HOT 3
- document interactive key bindings HOT 1
- document capturing multiline command output HOT 1
- New built function: filter HOT 4
- The digest of the windows installer is not stable HOT 2
- New built-in function: cons HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elvish.