Skip to content
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 (vim) mode / Vim keybindings #159

Closed
vgel opened this issue Sep 1, 2021 · 119 comments
Closed

vi (vim) mode / Vim keybindings #159

vgel opened this issue Sep 1, 2021 · 119 comments
Labels
Feature requests Feature Requests

Comments

@vgel
Copy link

vgel commented Sep 1, 2021

Describe the solution you'd like?

Use neovim to drive vim keybindings in the command editor.

Is your feature request related to a problem? Please describe.

I use Vim keybindings in ZSH (via https://github.com/jeffreytse/zsh-vi-mode) on my home machine. I haven't gotten around to setting it up on my work laptop yet, because it's painful, slow, and buggy. It tries to emulate vim using shell scripts, which doesn't work very well. It'd be really neat to leverage the native editor experience in Warp to provide a near-flawless vim mode like vscode-neovim does for vscode.

Additional context

@vgel vgel changed the title Vim keybindings Vim keybindings via neovim Sep 1, 2021
@manuraj17
Copy link

Just curious -- wouldn't it be better if we don't need the dependency on neovim to drive this?
Ofcourse offloading is better, but then having it native feels better for me.
Another use case is that I tend to use terminals on machines where neovim is not available -- one example while pairing. So, having an independent mode helps. Just my 2 cents.

@zheng
Copy link
Contributor

zheng commented Sep 2, 2021

We definitely want to support some kind of vim mode for the editor. Not sure what our approach will be, but this is a cool project!

When it comes to pairing, we want to support sharing sessions via the web. And one early thought I have is that there's no reason why everyone can't use their own preferred bindings when typing collaboratively (just like in Coderpad)!

@insufferabblejake
Copy link

Want to throw my hat into the support vim natively without needing neovim or the like.

@elviskahoro elviskahoro changed the title Vim keybindings via neovim Integration: Vim keybindings Nov 7, 2021
@elviskahoro elviskahoro changed the title Integration: Vim keybindings KB: Vim keybindings Nov 7, 2021
@elviskahoro elviskahoro changed the title KB: Vim keybindings KB: vi (vim) mode / Vim keybindings Nov 9, 2021
@mkomitee
Copy link

Something as basic as what set -o vi does in zsh

@elviskahoro elviskahoro changed the title KB: vi (vim) mode / Vim keybindings vi (vim) mode / Vim keybindings Dec 7, 2021
@tkennedy1-godaddy
Copy link

This was about 3 minutes of my life trying to figure out why vim keys didn't work in the terminal even though I've got set -o vi in my .bash_profile.

I have ctrl-a bound to other things so emacs keys are pretty hard to use for me. Oddly if I attach to a tmux session set -o vi works again though.

@elviskahoro
Copy link
Member

@tkennedy1-godaddy Hey Todd,

So the tldr; is the input editor had to built natively to support similar text editing experiences like VS Code. However this also means we'll have to build Vim keybindings ourselves. Once we launch custom keybindings in general, we'll then look to add Vi Mode.

@hms
Copy link

hms commented Feb 24, 2022

I know the Warp team has their hands full, but the lack of this feature really makes it very hard to adopt Warp full-time or recommend it as "ready to try". I hope this feature request will get some love and attention soon as it cuts off a lot of users and I really like Warp and would like to see it be wildly successful.

@laddhoffman-swarm
Copy link

This looks similar to #839 , which I see was just added to https://github.com/warpdotdev/Warp/milestone/4

@gkssjovi
Copy link

gkssjovi commented Apr 28, 2022

There is any solution to this?

@hollyoops
Copy link

Same here very hope Vim can be supported

@gschnaubelt
Copy link

Is there any solution to getting set -o vi working in bash + warp?

@hms
Copy link

hms commented Jun 14, 2022

It sure seems like the amount of communications from the Warp team has declined significantly. While I (and I'm sure most if not all warp users) understand how big an undertaking the Warp team is biting off, the lack of communications about a roadmap and approximate timing around what's important to me as a user means I've stopped beta testing.

This feature is simply one of several that are important to my productivity and with it, I can't effectively use, and no longer recommend, Warp.

@currenthandle
Copy link

Bump. Please integrate vim keybindings! This is a dealbreaker for me and I can not switch to your cool new terminal without vim keybindings.

@TanGuangZhi
Copy link

now i use zsh in warp to use vim...

@elviskahoro
Copy link
Member

@gkssjovi @gschnaubelt Still no solution.
@hms @currenthandle I just checked and it's currently set as low priority. And so I honestly have no sense of what the ETA is.

the lack of communications about a roadmap and approximate timing around what's important to me as a user means I've stopped beta testing.

We're trying to figure out this quarter how we can be more transparent about the roadmap.

On the communications front more generally, we're trying to hire more people so that we can improve our responsiveness. After the beta launch we (primarily me) got very overwhelmed with feedback and so sorry that I'm getting to this so late.

@dannyneira
Copy link
Member

dannyneira commented Jun 16, 2023

Hey Folks, This feature is on the roadmap and actively being worked on (no official eta). We'll post any updates on this thread once we have more to share! 🤞 Sneak peek below:

CleanShot 2023-07-18 at 11 14 31

@Meronkha
Copy link

+1 on this feature

@sebneira
Copy link

I really like the idea of warp, but unfortunately can't use it without key bindings. I'll keep an eye on this issue to see when I can come back.

@currenthandle
Copy link

Hey Folks, This feature is on the roadmap and actively being worked on (no official eta). We'll post any updates on this thread once we have more to share! 🤞 Sneak peek below:

CleanShot 2023-07-18 at 11 14 31

Hey @dannyneira happy August! Any way we can get an update?

@michaelmcmillan
Copy link

+1 for vi mode!

Also, this would suffice for me, as it allows me drop into vi with the current command:

set -o vi

@Amarlanda
Copy link

excited to see this being worked on +1

@evelant
Copy link

evelant commented Aug 24, 2023

Excited to see this in the works. Can't wait to try it!

@juancampa
Copy link

This would be a game changer if it supported text objects (e.g. iw, aw) which none of the shells I've used do

@dannyneira
Copy link
Member

Hey folks, we're making good progress on vi mode, adding more supported shortcuts every week! We want to make sure it's just right before we launch, so we appreciate your patience while we work on this highly requested feature. (@juancampa It will support text object shortcuts 🤌 )

@benlieb
Copy link

benlieb commented Aug 25, 2023

Is it not possible/easyish to simply have an embedded instance of nvim? I can even do it in Chrome.

@jeffschwartz
Copy link

Both Bash and ZSH supports vi mode, Bash directly via .profile, ZSH via ZSH plugins. These work in iTerm2 very well. Couldn't Warp tap into BASH and ZSH to do similarly?

@jeffschwartz
Copy link

Why create what the underlying shells mostly support already, e.g. Bash, ZSH. These allow vi integration either directly or through plugins. I don't believe this should be a terminal implementation. Rather, Warp just needs to integrate with the shell to support this feature.

@lucieleblanc
Copy link

lucieleblanc commented Oct 5, 2023

Hello fellow Vimmers, Lucie (@lucieleblanc) and Andy (@acarl005) here from Warp's engineering team! We've been working on Vim keybindings, and as of the latest release you can now use them in Warp's input editor 🎉

To enable them, navigate to SettingsFeaturesEditor, or search in the command palette with cmd-p, and turn on "Edit commands with Vim keybindings":
vim-keybindings-beta-settings-toggle

See the documentation here for a list of supported keybindings.

Vim keybindings are currently in beta, and we want to hear your feedback. We've been using this internally, but there are certainly bugs and use cases we haven't encountered yet. Although this main issue thread will be closed, please open new issues in this repo and upvote (:thumbsup:) existing Vim-related issues to help us prioritize them.

For those interested, we implemented Vim keybindings natively as a finite-state automaton (FSA) that plugs into Warp's input editor. We're hoping to write a blog post about it, and maybe open-source our Vim FSA implementation in its own crate – please upvote those issues if they would be of interest to you.

@djmango
Copy link

djmango commented Oct 5, 2023

This is great! Will try switching over to warp now from iterm2 full time. Is this bug reported? Nvim/lvim has borders around it
image

EDIT

Ah found it - #2373

Will hold off until this is fixed! Also seems that the settings UI for customizing keyboard shortcuts doesn't take Command as an input

@benlieb
Copy link

benlieb commented Oct 5, 2023

Great news that there is some movement in the pond.

A question. Since this is using a gui toggle, If I have set -o vi in an rc file it will have no effect? Or will is set from there?

@acarl005
Copy link

acarl005 commented Oct 6, 2023

@benlieb Correct, setting the vi mode in the shell (such as with set -o vi) currently has no effect in Warp. We are still working out the UX for interfacing with the shell's setting.

@nikisix
Copy link

nikisix commented Oct 6, 2023

Highlight of my week right here. Can't wait to get back into warp!

@dannyneira dannyneira unpinned this issue Oct 11, 2023
@danrasmuson
Copy link

They have listened and we have been heard!

@bdtomlin
Copy link

I'm very happy with this implementation. Great job, thanks for listening!

@apolzon
Copy link

apolzon commented Oct 18, 2023

Sorry to pile-on -- the implementation is indeed terrific (I've even been surprised by how thorough the command support is) -- I know that yall are working on better support for non-shell subshells (ie rails console, python, etc.) -- when/if that work gets completed, will the VIM support work there as well?

@djmango
Copy link

djmango commented Oct 18, 2023

One bug/UX issue I've noticed, when using J/K to scroll command history, it is essentially impossible to edit multiline commands as J/K just goes to the next/prev commands instead of navigating lines of the command. You are only able to edit without running by clicking with a mouse/trackpad, which defeats the purpose of VIM

@cshintov
Copy link

One bug/UX issue I've noticed, when using J/K to scroll command history, it is essentially impossible to edit multiline commands as J/K just goes to the next/prev commands instead of navigating lines of the command. You are only able to edit without running by clicking with a mouse/trackpad, which defeats the purpose of VIM

Ya, faced the same. Also ESC-v doesnt' work!

There's a workaround though - use fc directly.

@lucieleblanc
Copy link

Thank you all for the feedback! It is much appreciated.

@apolzon Yes, Warp's editor code remains the same in subshells, so I expect that Vim keybindings could work in non-shell REPLs too. However, I'm not sure how they would interact with REPLs that have non-standard bindings built in. Non-shell REPLs are not on Warp's roadmap for the next few months, so I can't promise anything there.

@djmango Currently j/k behave like up/down arrow keys, so the same problem exists outside of vim mode. We're working on finding a better UX for this, but please do open a separate issue for it so we can share and discuss ideas for a resolution!

@cshintov I'm not familiar with ESC-v. Could you open a separate issue to describe how you use it in other terminals and/or how you would like to use it in Warp? That would be very helpful!

@cshintov
Copy link

cshintov commented Oct 24, 2023

Anyone interested in this please like and subscribe 😉

command edit and execution feature like vi mode.

#3795

@ratbekn
Copy link

ratbekn commented Nov 23, 2023

+1 on this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature requests Feature Requests
Projects
None yet
Development

No branches or pull requests