New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vi mode missing #65
Comments
I think this is on the list of planned features somewhere… |
what is vi mode suppose to do? |
Emacs is a powerful text editing program. Usually the default for all shells is the emacs mode. This means that the command line editing can be performed by using emacs shortcuts. So Ctrl-a puts the cursor on the beginning of the line and Ctrl-e on the end of the line. Alt-f advances the cursor forward word by word while Alt-b works in reverse. Alt-d cuts a word and Ctrl-y pastes it etc. If you know emacs you can use most of its keyboard shortcuts to edit your command line. Vi/Vim is also a text editor program. The vi mode has its own set of shortcuts and it is modal. There is the normal or command mode and the insert mode. The command mode is used to browse the history and perform command line editing just like in vi. The insert mode is meant to insert text. So in the normal mode pressing 0 puts the cursor on the beginning of the line while $ puts it at the end. You can advance between words by pressing w or e and cut words by pressing cw (change word). Pressing p pastes the word back etc. The vi mode is very useful for people using vi/vim as their default editor. It is quite efficient if you know vi. If you are interested I suggest you to search on web more info about the subject. Knowing how to move efficiently on your command line is useful and interesting and most importantly more productive. |
That was a hell of an answer! Cheers. Sent from my iPhone On Jun 9, 2012, at 1:56 AM, Goran Josicreply@reply.github.com wrote:
|
=) |
okey, been using emacs all my life and i never thought of the vi/m isers around the world ;) |
If you plan to make vi mode, please make it display current mode (command/insert/visual). As much as I like vim I find vi mode in shell extremly annoying and unusable since I never know which mode I am in. |
@SebastianThorn We are out there brother. ;) @silenc3r That is an excellent suggestion. I highly second that. |
I second that. |
There's an interesting implementation of this being developed on the mailing list: http://sourceforge.net/mailarchive/message.php?msg_id=29431816 |
It is not complete yet but it is functional actually. |
@kalikiana Thank you for that link. I got it working and it looks nice. However, it's not on-par with the zsh vi-mode yet. It also seems pretty slow. Actions like jump back one word have a lag of a few hundred milliseconds. This script surely seems like a good start, but with the slowness I guess it can become somewhat annoying if you use it on a daily basis. |
|
zomg +1 |
+1 |
How's the status on this? |
Well, there is nothing in the release notes yet so I guess the vi-mode is still missing. You can check here: |
I'm not aware of any work being done on this, though obviously it's highly desired. I'd like to do it but I'm not a vi user, so it'll take me a while to ramp up. On the other hand it makes an excellent excuse to learn. |
I would love to see this become a reality! On Mon, Feb 18, 2013 at 10:09 PM, ridiculousfish notifications@github.com
|
There is a partial implementation of vi-mode here. It's not updated currently. @ridiculousfish, I think one of the main obstacles which makes it difficult to introduce a vi-mode is the lack of bind modes: the ability to quickly switch a current set of bound keys to another one is highly desirable. Introducing it will greatly simplify extension of vi-mode bindings by the ordinary users. bind -m vi-normal i 'some action' # for the key 'i' to work only in vi-normal mode
bind -m vi-normal # to switch to the vi-normal mode, where only 'i' key is defined There was a message by Ian Munsie (the author of the vi-mode) on a fish shell mailing list with a feature request he needed for his implementation of the vim mode. They might be still relevant:
|
|
I'm waiting for this too. |
|
+1 I've just discovered fish and it seems great. But using bash in vi-mode for years make it a deal breaker for me. Nobody mentioned it, but vi-mode is not a bash or zsh feature (provided they did not rewrote it totally), it's a readline feature : http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC22 I see a few readline references in codebase, but mostly about a "inject readline function" option, so I'm not sure if fish use readline. If it does, I suppose we could have a basic support by switching its mode to vi on fish init. I'm afraid it's not the case, though, as setting |
good find @oelmekki, all new to me |
I'm not convinced vi-style really works well for a command line, even though you could consider me a hardcore Vim user. It's really shitty in readline, and actually even in Vim I use vim-rsi to get the default readline bindings in Insert and Command mode, because they're just better for single-line input with minor editing, which is what you tend to do in a shell. However, fish actually makes multi-line commands more useful, so things might be different in fish. If we do this in fish, I think it's important that we avoid the limitations of vi-mode in readline, which for me means making it clear which mode you're in (such as by putting it in the prompt and repainting it on mode changes, and/or in the terminal title) and that it supports Vim's features for multi-line editing and the operator-pending mode. That means things like However I'm not sure if having two completely different key bindings supported is in line with fish's design philosophy. Might be fine to extend |
@dag Well, your proposition is surely interesting, and I would be glad if this happens. But just to be clear, I would love to have an implementation as "shitty" as readline's one instead of nothing, if your view of correct implementation happens to be too difficult to realize. |
same here. I really like the suggestions dag made and it would be great to have that implemented but I would settle with the readline support gladly. |
I sympathize but I think that way lies zsh: there's a feature or configuration option for everything, but nothing feels quite complete or thought out. fish on the other hand tries hard to not make anything an option (but of course it's unavoidable) and to prefer quality features over quantity. But at the same time I think that fish tries to be highly customizable, which isn't the same thing as configurable. What I mean is that it provides the tools to let you easily script any feature you want. Take for instance my recent comment over in #128. That's what I'm after with extending |
Hi, can you tell me more on what you mean here? My use-case:
|
Any changes on that question? Would love to use vi mode in fish! |
Bottom line:
|
@pirj: I'm going to confirm this. Make a good patch, submit it, and it will be accepted for next fish shell release. fish-future is intentional - it isn't high priority (because it's relatively complex), but that doesn't mean developers don't want this feature. The patch implementing bind modes, or something like that would be preferred. |
For those who cannot wait the official |
You might be interested in this: #1218. |
Probably won't ever use fish, there are still some massive features missing fish-shell/fish-shell#165 fish-shell/fish-shell#65
+1 |
1 similar comment
+1 |
Fixed by applying #1218. This is not an April Fools' joke. Now the +1 flood can stop. If you want to test new vi mode, download the newest master, and run @furunkel: Feel free to apply for $200 at https://www.bountysource.com/issues/986070-vi-mode/bounties. You probably are aware of this bounty, if you read this topic, but I mention this just in case. I believe your patch wasn't easy to make anyway, so you definitely deserve this bounty from the community. |
Thank you very much! |
Awesome, thanks !
By the way, if this annoys you, make sure to report it to github. A +1 |
Thank you, @furunkel! |
OMG this is soooooo cool! And just in time, too! |
The $200 bounty that was posted on this issue waiting to be claimed, @furunkel :) |
Is there any information on when this feature will be included in release? I don't see it in 2.1.1. |
It will be in the next minor release (2.2.0). |
Ugh, I just updated fish nightly on my machine to the version fish, version 2.1.2-1247-gfbe28fd and now after command execution vim mode always jumps in to insert mode. I have hard times understanding what has changed. Any tips? Thank you. |
Most probably this has changed. |
How do other vi-mode users feel about switching to insert mode after command execution? I merged that because it's what bash and zsh do, so I assumed it would feel natural, but maybe I was mistaken. |
Maybe I overlooked in the documentation but it seems to me that the vi mode is missing. I think that fish shell is awesome but without the vi mode I cannot use it as my everyday shell. Is there any way to enable the vi mode in fish right now?
Maybe it is possible to achieve this through the configuration somehow although I have doubts. It is more likely that this is a missing feature.
Thank you very much for all your work.
The text was updated successfully, but these errors were encountered: