Vscode: Vim Style Key binding

Created on 1 Mar 2016  路  108Comments  路  Source: microsoft/vscode

There are a few extensions in the marketplace for Vim, however Vim key bindings is still such a hot request in User Voice. Can VS Code / Vim users chime in on what is currently missing?

VIM feature-request

Most helpful comment

Please implement this in the core, the extensions out there are not very useable.

All 108 comments

ping @jasonyueyang

Looking at this extension, there seems to be some solid work done and a good community around it. Commits going through today and a roadmap of work to be done.

The ones that exist are pretty poor at this point, not even usable. I use VIM and in Visual Studio VsVim, and I can't even use the extensions that exist for VsCode.

@kellyelton have you opened bugs on their extension? They seem to be pretty responsive and have closed a number of issues.

There are some severe limitations with that extension's implementation that make it difficult to operate. I have been fumbling around without Vim bindings to avoid the quirks for now, but I won't be able to stay with VSCode for long this way. As I recall, auto-closing of brackets, auto-complete, and snippet completion (including emmet), all fail in some way. Also, some essential motions are missing.

I'll try to get around to actually producing a complete list if someone else doesn't get to it first. For reference, Atom's current Vim plugin is spot on.

I've used that one and this and sadly they are not even close to completion, some mention issues with whats available in the API in regards to keybindings. I use VsVim daily and its not even close.

Another issue IMO is there are at least 3 implementations, would be much better if it becomes one so everyone can work together. Maybe you guys can make this happen.

Well I don't even use VsCode, this one is kind of a blocker for me. Also, it's just not far enough along to address any work that I currently do either. So no, I haven't opened any tickets, I figured I'd just throw in my two cents that what exists is not even good enough to install.

This is actually an issue for lots of editors I've tried recently. The only good vim experience outside of vim is VsVim.

@NickClark that list would be excellent. @Beatusvir good suggestion and I hope to help this happen.

And in case you were not already aware :grimacing: , this is a critical issue for adoption. I'm the only one at my company that uses it right now, others opt for Atom based purely on the Vim support.

I don't use VSCode either (yet) as it has no benefits to me over my current Vim setup. The only thing I am very interested in using it with is reliable cross-platform C# and ASP.Net development. The current C# integration with Vim sucks.

To everyone here using Atom - I wonder what features it has that rival the "real" vim with an appropriate set of plugins?

@paralin I don't use atom but comapiring to VsCode, is for sure ease of configuration, Ctrl-P install x-addon and I'm done. We all know for vim after downloading (using a manager or not) is usually followed by some configuration. For now I'm using WebStorm (@home) with its Vim plugin which works just fine although you get prone to spam scape a couple more times than whats healthy (it has some issues with menus and vim insert mode).

@Beatusvir It might be better to try to go the other direction and develop a plugin manager for Vim that doesn't require the long configuration phase you mention.

http://github.com/paralin/PersonalJanus

There's one manager I use called Janus that's very nice, it doesn't use a long list of plugins to install things but rather opts to just use git submodules. I think it could be cool to develop a CLI tool to pick what features you want, and also make it portable via git (as I've done).

Either way this seems a bit out of scope for this repository. But I would like to see proper Vim support in VsCode that doesn't rely on a gimped plugin API.

Like others said before, the current Vim plugins for VSCode aren't usable yet, though they are great projects. VSCodeVim/Vim is particularly interesting because it's very active and the contributors worked on Vim plugins for Sublime and other editors.

I guess one thing that would be great is for VSCode to provide more APIs that could facilitate those projects develop a plugin with better Vim keybinding feel and behavior.

The alternative would be to bake in Vim keybindings as a built-in option into VSCode.

@waderyan awesome that you guys are actively looking into this - I am pretty happy with vim-support in VsVim, WebStorm and Atom and I would love to give vscode another look as soon as the vim-story is decent. Maybe @jaredpar could give some hints on what to look out for.

Missing essentials:

  • Numeric arguments (3dd, 2x, ...)
  • support for combining commands (ci[, cW, ggVG, ...)
  • visual commands
  • window interaction support, split windows, close windows, switch windows, ...

Nice to have:

  • Cursor customization: Give me the possibility to customize the form (block or line) and color of the cursor, e.g. for Normal Mode, I'd like to have a green Block cursor, in insert mode a red line cursor.
  • vim leader support.

For Editors with good VIM support look at Emacs with Evil or IntelliJ's IdeaVim.

+1 for

support for combining commands (ci[, cW, ggVG, ...)
visual commands

Maybe if a plugin would take advantage of the Neovim api to bring in full power of Vim instead of trying to merely emulate vim key bindings. It could be possibly game changing, allowing to tap full potential of vim ecosystem and configuration.

None of the plugins yet support the "dot" . command, which repeats the last action. That is really important.
VsVim is excelent, it works as expected. That should be the goal.

yeah . and ; are important to me too

This is great news! This is the only feature stopping me from switching to VSCode. For me a critical feature is the ability to remap the ESC key (exit input mode). It would also be great if macros were considered at this stage, few implementations of vim mode in other editors support this due to the limited API accessible, and looking into it now could make it possible in VSCode, together with . and ;

I echo the above comments. A single, high fidelity vim mode is key to adoption.
I've briefly tried the available plugins, but they are both too far short of usable for me to put any time into them, so back to Atom for now.

Specificaly I rely on full mode support (https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes) including ex-mode, so imho, vim support is more than just a bunch of key bindings.

pinging @74th

+1 for VsVim as the initial goal.

I use Visual Studio with VsVim full time and am very satisfied.

I use the various numbered repeat commands, yank and paste buffers, s/find/replace, dot (repeat last whatever), and q record/replay macros. Also J to merge lines, and the various keys that jump to positions within the current line or file.

I would like to start writing C# apps on my personal Macbook Pro for deployment to Linux webservers, and VS Code looks like a great tool for it, but I really need something very close to the feature set in VsVim before I switch away from command line Vim.

:+1:

+1 with @mswift42 on essentials. You should provide something that helps VsCode-Vim integrate better.

Atom has a good enough Vim implementation. For me IdeaVim and VsVim work fine, so the feature sets that they support should be what VsCode offers as well.

I would look at VsVim (Vim extension for Visual Studio) as an ideal initial goal.

I'm making this plugin and use VSCode with it everyday.

https://github.com/74th/vscode-vim/

It supports numeric arguments and visual mode.
I like VsVim too. But I think there is no need for command line mode, like VsVim.

I agree with mswift42, but I would like to add:

The ability to bind keys in a fairly flexible manner is (in my opinion) critical for usable vim support. Many users designate a key called leader, often ','-key, and then bind gt or a to whatever.

I' ve personally grown attached to ,gt for "go to (c)tag at cursor" (go to definition) and ,gf for "go to file whose name is at cursor".

I'm the maintainer of https://github.com/aioutecism/amVim-for-VSCode.
The biggest problem I and other vim plugin developers are encountering is support for custom keybinding context (as I asked here: #1432).
All the other vim behavior can be implement pretty simple and quick with the framework we Vim plugin developers built.
I'm seeing support VIM extension authors on roadmap https://github.com/Microsoft/vscode/wiki/Roadmap . And I hope the keybinding support for plugins would be added by the end of March.

Something like this is the holy grail of vim binding:

https://github.com/carlosdcastillo/vim-mode

It's pretty buggy though. But that would be a nice direction. Let neovim do all the work but still have intellisense, etc with the editor.

This feedback is excellent. Vim support is gaining momentum on the feature request list and with some of the essentials near completion (accessibility, localization), we can spend more time here. We're looking at rolling out a holistic strategy to improve Vim support and involve the community. Keep the feedback coming!

@aioutecism I'll talk to the team to get #1432 higher on the priority list. Specific requests like this are excellent to feed into the backlog.

@aioutecism there other other issues labeled vim in our backlog. What ones of these are critical to your development?

@jpoon, @guillermooo, @74th, @mattn you are also developing a vim extension. Can you address the question above?

What other issues are you facing with working with the current extension api?

Thank you very much @waderyan. I'm looking forward to the new API.

Another problem I'm encountering is the need to deal with different keyboard layout.
I opened an issue #3671.

In my extension's case, other issues labeled vim are not critical or can be solved perfectly if #1432 is done.

Wow, this is awesome -- validates our work over at https://github.com/VSCodeVim/Vim :fireworks:

VsVim for Visual Studio as an initial goal

That is a lofty initial goal -- I view it more as the gold standard. I met up with @jaredpar (awesome dude btw!) when I had just started the VsCodeVim project, and there's definitely a lot of work involved with getting any of these VSCode VIM extensions to that state. It's unfortunate that there's no way to port all the good work VsVim or any of these other IDE extensions have done.

As for VIM on VSCode, addressing these issues would be a start: https://github.com/Microsoft/vscode/labels/VIM. In developing the VsCodeVim extension, there's been a couple of other major difficulties:

  • Dealing with International Keyboards -- @guillermooo did some awesome work for our extension to be able to handle international keyboards (es-ES, de-DE, etc), but I think this should inherently be something that VSCode deals with as all extensions that deal with keybindings would have this problem.
  • To expand on @aioutecism point, the existing keybindings system is pretty bare-bones. A problem that we consistently see with our extension is that would would bind a key, do some VIM stuff, and then find out after that fact that we broke some inherent IDE behaviour (e.g. auto-braces, auto-completion). An easy work around may be to be able to pass the binding back to VSCode to handle -- "our extension is done with this key, go do what you usually do VSCode"
  • Cursor Styling although that may have been addressed with https://github.com/Microsoft/vscode/issues/561

@waderyan: are you on the VSCode team? Looks like you are in Redmond, I'd be happy to meet in person to discuss.

I really do appreciate all the good will VsVim has gotten on this thread. It's what makes OSS projects worth doing. :smile:

VsVim for Visual Studio as an initial goal

But I think that is probably unrealistic for an initial goal. VsVim's been in active development for about five years now. Can't expect a new vim emulator to get to that level for an initial release.

Instead I'd focus on hitting the core scenarios for an initial release. For example: motions, key mapping, ., and a few normal mode commands. Once that is in place it's easier to branch out and do other features in parallel because the basic pipeline has been established.

@jpoon yes I am and that would be great. I'll reach out when I'm back in town to set something up.

Since this thread is generating a lot of traffic -- here's another VIM related issue I just filed: https://github.com/Microsoft/vscode/issues/3695

My plugin has belong poricy.

  • do not distutbe vscode functions

    • not support . q (disturbing suggestion)

    • not support functions using Ctrl-key (other extentions use them)

  • you should use functions vscode has

    • not support u(ctrl-z) ><(tab) :w(ctrl-s) :q(ctrl-w) vimrc(settings.json)

  • support other vim functions

    • already complete: 3w c3fc p v ...

    • uncomplete: V "ay ma `a

I'm offering non-vim users to use VSCode. My goal is not VsVim. VsVim lesses stresses vim users has, but I cannot answer which keys you press to format code and replase strings with regular expressions in VisualStudio.

An additional function of plugin system I want is, _a switch of contribution point_.
Contribution points of my plugin is "when": "editorHasSelection" to divide Insert mode and normal mode. I do not want to catch keys in insert mode. On the other hand, VSCodeVim/Vim calls editor.action.triggerSuggest in anytime. Users having mode concept are not only vim users, they want it too.

For me, you could completely replace VsCode default keybings. Or offer an options file that I could edit. Not having :w or u sucks. You are not addressing VsCode users with a Vim pluggin, you are addressing Vim users that are interested in VsCode. I simply will not use VsCode until it has a decent Vim plugin.

Also, I love that VsVim is able to load .vimrc from my profile. That would be an extended goal. I love that my jj mapping to ESC from .vimrc are automatically picked up by VsVim, for example.

Also, I love that VsVim is able to load .vimrc from my profile. That would be an extended goal. I love that my jj mapping to ESC from .vimrc are automatically picked up by VsVim, for example.

This.

For those interested, I think the API on the vscode side is good enough now (on master) to support a good vim emulation extension.

Please see https://github.com/alexandrudima/vscode-vim if you are authoring a vim emulation extension for a sample using the new API.

Gonna check it, but from the readme, the basic commands are all implemented in every extension because as you said, it's supported with the api and easily implemented.

However, for us long time vim users we've created a lot of customization to our vimrc (first issue, read the vimrc config) which include a lot of key mappings (almost nobody use Esc key, instead jj or Caps or whatever), leader key (usually ,) and that's when the trouble begin. Mixing commands is another problem if I recall.

  • Missing -
  • Delete commands such as such as ...
    d$ = delete from cursor to the end of the line
    df[char] = delete form cursor to [char]
    di[bracket] = delete everything in bracket (This kinda has ties with visual mode which has been mentioned)
    more...
  • I can't press "f" then a [char] to jump to that next occurrence of a given character later in the line. Same with F same functionality backwards.
  • "/" for searching is missing

There is a hefty chunk of VIM functionality here good job :). Can't wait to use this when its all fleshed out.

I started using vscode because of the extension mentioned by OP, upon finding that extension being very poor with plenty of bugs, I had to switch back to vim.

I tried installing a vim plugin for vs code and found it unusable as well; simple bindings didn't work (ie. yyp). I understand it's a work in progress. Therefore, I'd like to provide some feedback on what I'd expect out of a vim plugin. :)

Here are the important key bindings for me:

  • basic commands need to work (yyp ddp p vs. P cc C etc...)
  • simple searches (* to find all instances under cursor and # to search in reverse)
  • finding text with / and ?
  • quick edits are crucial (ci" di" vi" va" ciw daw cit dit ct] cf<char> de ...)
  • marks need to work (ma / 'a and mA / 'A)
  • command line mode (:%s/find/replace/g and :sp :w :wq :e filename etc...)
  • macros (qa<do stuff here>q, then 22@a)
  • named registers ("ayi( then vi("ap)
  • :+1: for supporting my ~/.vimrc or ~\_vimrc configs

Everything I've listed above are very important bindings for me, and I'm assuming most Vim users. I personally use them everyday. They are considered "standard vim functions" in my eyes. I develop in MS Windows 90% of the time and use ViEmu in Visual Studio 2015 and SQL Server 2014 all day. it's an absolutely stellar product, and I can't live without it! I did use VsVim for a while and it was great as well. If I remember correctly, it lacked in command line mode for me and had some other small issues with recording macros. I'm sure many of my ailments have since been fixed. Regardless, I currently use ViEmu and have very few complaints.

The biggest problem I've had with all Vim plugins is the way vim bindings work against standard windows shortcuts. For example, <c-v> is typically paste, but in vim it's for visual block mode. There are other bindings as well that I always butt heads with like <c-o> for traversing jump lists and not "File Open", <c-n> for word completion and not "File New", <c-y> for scrolling.. It's a tricky puzzle for sure.

Thanks for creating this case and requesting feedback from all the Vim users. I sure hope to see a solid vim solution for VSCode. In the meantime, I'll continue to use Visual Studio 2015 with ViEmu.

For those interested, I think the API on the vscode side is good enough now (on master) to support a good vim emulation extension.

Please see https://github.com/alexandrudima/vscode-vim if you are authoring a vim emulation extension for a sample using the new API.

Just updated my vim extension to use these new APIs. Works amazing!!!
https://github.com/aioutecism/amVim-for-VSCode
The new API is only available from VSCode 0.10.12. If anyone is interested, download the insider build and install amVim to give it a try.

@aioutecism Awesome!!!

@aioutecism please don't play with my feelings gonna try it now

@Beatusvir
It doesn't support custom keybindings now. So you might be a little disappointed.
The most wanted features are issued here.
I'm trying my best to make them happen as fast as possible. And I really need your help!

To add to what others have said. I really miss :reg to view the registers. Also, though not part of the core Vim I think surround with should be core when there is so much html now a days. but perhaps a pluginsystem that would allow vundle or patogen directly? dreaming...

@elgrego I believe having surround functionality shouldn't be an issue, it could be something like just a new command on a visual selection.

@aioutecism I'll do my best to help! specially since one of my most used commands (ciX) is not implemented yet. I'll check your code asap (currently at work). Good job man :+1:

@Beatusvir Yeah, like vat + '

' should create a div around the current selection. Even better would be to have emmet style commands with the current selection so that vat + div|span c+y, would create a div around this and then a span after.

:+1: for @elgrego's suggestion on supporting pathogen. This kind of falls into the original suggestion from @giggio to support existing ~/.vimrc files. In doing this, you could delegate the surround functionality to other community built vim plugins like https://github.com/tpope/vim-surround

@aioutecism This one is actually usable with .12, way to go man!

Macros (q) and Multiline editing (vj>) are needed. Neovim integration would be awesome.

My big 4 (before anything else imo):

  • [ ] open
  • [ ] wq
  • [ ] yyp
  • [ ] line number command support like :2,10dd

VSCode new vim support is very powerful.
I get to make the most of function I want.
Very thank @alexandrudima .

I make repeat command(.) for my vim plugin (74th/vscode-vim).
Complex command, repeat command and visual mode are available.
I'm looking forward to next vscode release.

With all due respect to the existing VSC Vim extensions, none of them provides anything close to the sort of quality support provided by say JetBrains for their range of (IDE) Editors.

For an example of what is required to be built by Microsoft (yes, you, please stop stalling with comments like we are actively evaluating but checking what is missing in Open Source - nothing has changed from a year ago when I last voted on user voice) - see ideavim - this includes all the usual keybindings, visual / command modes, and Macros support etc.

Please just get started, and stop stalling for time - this is the feature that will attract thousands of *nix / Mac devs to this otherwise awesome Editor. Would add integrated terminal support and tabs are the other two features very much needed.

An extension on par with ideavim is definately what is needed. Existing VS Code extensions are nowhere near ideavim. Microsoft should really pick this up and make this Vim extension.

One thing I wanted to add: ideavim uses a simple parser for .vimrc. Works good. To have something like that would also attract more Vim users.

Ah, and tabs, tabs are even in Vim considered bad. Vim users seem to prefer buffers and windows (as layout mechanism) over tabs.

馃憤 - really love the lightweight, snappy implementation of VSCode. If it had similar support to IdeaVim I would most likely be an overnight convert.

:+1: I too would be a quick convert and spend more time developing in VSCode with better Vim support. I currently use VS2015 (with ViEmu), gVim, and/or WebStorm (ie. with IdeaVim), depending on the project I'm working on.

:+1: To date, the VIM extensions are very buggy for me (right now mine never paints a cursor among other issues). This needs to be implemented in the core product.

@waderyan, back to the original question:
There are many things I use on a daily basis that are not in the current extensions.
YY, yank a line, diw, delete inner word, visual selections, ciw ci", change inner.
After going through a couple of the standard commands one realise that the question is a bit strange. There are hardly anything but the most basic movements in the current extension so the answer would be _everything_

@elgrego
Have you tried amVim?
We have yy, di", ci", visual mode, visual line mode and many other commonly used commands implemented.
I use it every day, and I'm keeping adding commands people asked frequently.
Contribution are welcomed too.

@aioutecism is it on par with VsVim, IdeaVim, ST3
Vintageous? Are there any limitations to the plugin API that would keep it from supporting (or slow down) core vim functionality (cursor configuration, macros, regex search, : commands, etc.). Does it parse .vimrc?

If it doesn't, ST3 is a superior editor for me.

@aioutecism this was much better,
I stil miss ciw, diw, daw, dd, ctchar

@elgrego
Thanks!
dd and ct{char} should work.
"Word text object(ciw, caw, diw, daw)" support will be added soon.

@cchamberlain
Not now.
However, besides : commands, most used vim commands are on the road map.
We have a good code base, so it's only a matter of time to implement them.

@aioutecism - I installed it. This is definitely much better than the other VIM extensions, great job!

Would still like the core product team to get involved so we can get things like / using regex instead of the built-in search tool as well as the rest of the common VIM features that are expected out of a text editor.

Here is one of the best Atom vim plugins https://github.com/t9md/atom-vim-mode-plus

Ideally, I would like to see VSCode keybindings to have the option to be context based and allow key-chords and key-chains. If these keybinding options are built in to VSCode keybinding support, most vim support could be configured into using only keybindings themselves.

For example, something like:

[
    {
        "key": "l",
        "command": "cursorRight",
        "when": "editorTextFocus && normalMode"
    },
    {
        // press and release 'd', then press and release 'd'
        "key": "dd", 
        "command": "editor.action.deleteLines",
        "when": "editorTextFocus && normalMode"
    },
    {
        // press and release the chord 'ctrl+a', then press and release 'ctrl+d'
        "key": "ctrl+a; ctrl+d", 
        "command": "editor.action.deleteLines",
        "when": "editorTextFocus && insertMode"
    }
]

I know this doesn't cover all of the bases but it would certainly help to be built into VSCode itself.

If amount of fancyness is no issue, supporting regex based mappings too would be amazing:

[
    {
        "regex_key": "([0-9]+); d",
        "command": "editor.action.delete(\1)",
        "when": "editorTextFocus && normalMode"
    }
]

Please implement this in the core, the extensions out there are not very useable.

Sometimes now and then I check in on this issue with the hope of, like a christmas present, a Vim plugin that does everything the excellent vsvim does for visual studio. Any progress?

@elgrego It's already there! Quite usable.

https://github.com/VSCodeVim/Vim/

Merry Christmas!

Wow, thank you Santa 馃巺!

馃巺

If we consider VsVim (for Visual Studio) a baseline, all extensions are very much behind. They are usable, but an experienced Vim user gets pissed off very frequently with the missing features.

@giggio people wrote the same about VsVim when it first came out (comparing to ViEmu at the time). 馃槃

It's basically impossible to have a vi emulator that makes 90% of the users happy on the initial release because there is no 90% use case for vi. The set of commands, modes, mappings and incredibly easy customizations mean that almost every user has a different core use case for vi. It means making 90% of the users happy is equivalent to implementing 90% of vi (tough).

I've been a vim user for almost all of my programming life. Even so during the first two years of VsVim virtually every bug report I saw was a feature I'd never heard of or new way to use a feature that I'd never encountered before. It was pretty daunting.

VsCodeVim seems to be taking the right approach here though: just keep implementing features. Every time I get an update it seems to have fixed the most recent annoyance I was experiencing. It was certainly hard to use in the initial releases but lately it's gotten much better. I rather enjoy using it now.

I agree the extensions are getting better. I hope it gets there fast! ;)

Thanks @jaredpar!

@giggio, as a developer of VSCodeVim, please make issue requests over on http://github.com/VSCodeVim/Vim rather than just getting pissed off! We're happy to help.

@giggio and anyone might be interested: I happen to be a developer of both VS Code and VSCodeVim. Feel free to file feature requests or issues on vscodevim, let's see what we can do to make it better from both sides (Code and extension), together.

thanks @jaredpar you just made my day.

In vscodevim i still miss surround-plugin for vim and possibility to control all sidebar tools properly with the homerow(or may be i miss something how to do it)(or atleast some plugin compareble to advanced create file in Atom so i can work without the mouse most of my time), and i_CTRL-W that deletes all tabs and a "word" on previous line. It needs just delete all tabs first.
Other than that it is already have a lot of features, even good ex mode. Thanks for your work guys.

I just tried vscodevim, but alas, no support for tags (which is marked as low priority).

For me this is unfortunately essential, not only to navigate through my code, but often Source Code is the best documentation.

@monkoose @mswift42 feel free to file issues and add reactions to existing one in https://github.com/VSCodeVim/Vim :) We do have a lot of passionate contributors there and they are willing to help, just lack of feedback sometimes :)

@mswift42, the reason that tags are low priority is because VSCode already has excellent support for tags. Try cmd-t or ctrl-shift-t. If that's not good enough, you should let us know what specifically is lacking.

@johnfn On my box pressing ctrl-shift-t does nothing. (This is using Linux). The working Key Combo here is F12, which is far far away from my Homerow. Also, how do I get back ? Under Vim, or Editors with good Vim Support, I'd use Ctrl+] to go to definition and Ctrl+O to get back where I was.

@mswift42 You just need to learn more about how to rebind keys in vscode. And then just rebind showallsymbols command to a map that you want. Because by default vscodevim override ctrl-T behaviour.

@monkoose Thanks for that. Of course I'm not interested in showallsymbols, but in navigating quickly between methods / files.

@mswift42 You can rebind Go To Definition command then. Its easy to do in vscode.
Add this to your keybindings.json

{ "key": "ctrl+]",                   "command": "editor.action.goToDeclaration",
                                     "when": "editorHasDefinitionProvider && editorTextFocus && vim.mode != 'Insert'"},

@monkoose Isn't Go To Definition in VsCodeVim already bound to the gd command?

@monkoose: And now we are nearly half way there. I press Ctrl+] and am transported to its Definition.
But how do I get back ?

@hastebrot Yes, seems so forget about it. Thanks.

@mswift42 I do not use vscode so much(really miss surround plugin). I think the guys behind vscodevim still do not implement cursor jumps with CTRL-i and CTRL-o. Just checking it sometimes to see how far they go.

@mswift42 If we're still speaking about vim/VsCodeVim this should be ctrl+o (previous location) and ctrl+i (next location).

@hastebrot Do not work for me.

I think the guys vehind vscodevim still do not implement cursor jumps with CTRL-i and CTRL-o

Tested it with vim.useCtrlKeys enabled. Indeed this is not implemeted.

That's what I was trying to say. To support jumping between tags, gotoDefinition has to save the current Cursor position, jump to the definition, and when Ctrl+O is invoked, going back to stored position.

Seems VSCode doesn't support this history next/prev functionality. I find nothing in the keybindings.json.

Update: However there are Go > Back and Go > Forward menu entries.

The default (on my system) is:

~json
{ "key": "ctrl+alt+-", "command": "workbench.action.navigateBack" },
{ "key": "ctrl+shift+-", "command": "workbench.action.navigateForward" },
~

A vim-like binding would be:

~json
{ "key": "ctrl+o", "command": "workbench.action.navigateBack" },
{ "key": "ctrl+i", "command": "workbench.action.navigateForward" },
~

But beware this seems a bit sloppy. Maybe this is also mentioned in the VsCodeVim documentation.

@mswift42 I trully believe that you can implement something what you need with the marks(they are supported in the vscodevim). Not the full ctrl-o functionality, just jump back to the line where you were. Do not tested myself but vscodevim support .vimrc configs so you can do some mark before jump(autoadd it when you press ctrl+]) and then add another keybindig to jump to that mark. At least for now. Or stick with an editor that you work for now and check this feature later.
I'm too for now can't work in vscode. But i really like it besides some missing vim features.

@hastebrot Seems like working. At least for first glance(may be has some bugs though do not sure). So my comment is useless.

@monkoose I observed some problems with gd, then multiple ctrl-o, then ctrl-i inserts some strange history items inbetween. Or gd, then ctrl-o, then j jumps somewhere multiple rows below.

Update: I could not reproduce the first issue after an update to the newest insiders build. Could be fixed in the update, could also be me trying to reproduce this issue in the wrong files.

It's been a while since this issue was last looked at, but I did download VSCodeVim today and I am rather pleased with it. It's also offered through the welcome page of VSCode. Therefore I don't see any reason to keep this issue open. Any further enhancement requests should probably go to the VSCodeVim repository.

This maybe should be a separate issue, but I just tried it and clicking the Vim link didn't do anything. I had to click others link before the menu on the left opened and I saw how to install Vim.

@daveisfera Curious, the link worked for me. That's actually how I discovered the extension. I wish we had more info on why it might not be working for you.

Yes Vim support is good now I would say this should be closed.

It is just a matter of improving the existing APIs and contributing to the existing Vim plugins at this point. The plugins, though not perfect, are useful right now.

I agree that this should be closed.

Is there any Vim plugin that has textobj support implemented? The atom vim plugin supports commands like dif (delete inner function) ci' (change inner ') and so on.

Textobj and the Jumpy extension working with the Vim extension are the 2 main reasons I am staying with Atom. The plugins are way more matured and usable in Atom and simply just work as expected.

@fasa123 VSCodeVim supports text objects. Things like daw, ci', ci(, yap etc. all work. dif is not a text object in Vim as far as I know, so it's not supported, but you can feel free to add it if you'd like! I actually added a custom text object af which selects ever-increasing blocks of text, so it probably works in a similar way to the dif you're used to.

You are right. They in fact do work I don't know whats wrong with me wow.

Also the af command surprisingly works really well thanks for pointing this out.

Also I assume there wasn't any further developement on that whole "multiple-extensions registring hotkeys for the same scope" (Jumpy&Vim) dilemma? In Atom I could register the f hotkey for normal mode to call the Jumpy extension. This combination is really one of the only things missing to me personally anymore.

One other question though. Is there a way I can use daf instead of first having to vaf then d?

Thanks everyone for the contributions in this issue. As some have observed, the remaining work is in the extensions. Therefore, I'll close the issue.

@fasa123 @johnfn pls take your conversation to an issue in https://github.com/VSCodeVim/Vim/issues.

Was this page helpful?
0 / 5 - 0 ratings