VSCodeVim / Vim

:star: Vim for Visual Studio Code

Home Page:http://aka.ms/vscodevim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neovim Integration Feedback

Chillee opened this issue · comments

We have now added Neovim integration for Ex-commands. Enable it with vim.enableNeovim. Note that you must have neovim installed for this to work.

What are opinions on neovim being an optional dependency / maybe becoming a mandatory dependency down the line? We might be able to bundle it together with the extension down the line.

People clearly want neovim support. What are the main reasons for that? In other words, what features from neovim integration would you guys like to see implemented first?

Also, please come to http://vscodevim.slack.com! We'd love to hear discussion in there (discussion/feedback tends to be a bit quicker in there).

In other words, what features from neovim integration would you guys like to see implemented first?

Reading .nvimrc (mappings etc) and using plugins from vim/neovim in VSCode (everybody a lil bit a freak, do not judge me)

@FelikZ So for you, reading key mappings from .vimrc and plugins? What are the main plugins you're interested in?

@Chillee I would love to see support for following plugins:

  • vim-fugitive
  • tcomment_vim
  • vim_surround

@aakashsigdel Surround and Commentary/Tcomment are both already implemented. Vim-fugitive support is something that seems very difficult/impossible even with full Neovim support (although I'm not ruling it out completely). Vim-fugitive is too closely tied to vim display elements (buffers, tabpages, splits, etc.)

I have some ideas about how it might be possible, but honestly, it seems unlikely that vim-fugitive will be able to be supported properly.

@Chillee
First of all I really really appreciated work that VSCode team being done. Thats awesome and most of my daily needs are already being covered, thanks for that.

What are the main plugins you're interested in?

Some of day-use plugins are missing (or partially missing).
plugins:

  • argwrap - really really missing this one, extremely useful and if we look to a source it mainly using vim commands to do its magic;
  • vim-easymotion - I am missing easymotion-sn (replacement for search, where you can navigate search results using tab and then jump to a specific place by a key) and easymotion-s2 which allows to use multiple symbols for jump;
  • vim-unimpaired - features like line moving and spacing between lines are already being implemented in VSCode, so easy to bind and re-use. But some are missing.

key mappings from .vimrc

It is solvable by settings.json in current Vim plugin and so I moved most of mappings by hands. Most of them works as expected with some negotiable issues. I have spent a lot of hours doing this while reading them and adopting to VSCode automatically (where possible) from .vimrc/.neovimrc can save a lot.
But I understand that probably it does not make sense to support this since it is hard to implement/support and anyway will lead to errors due to differences/inconsistencies between editors. On other hand if complete vim implementation in VSCode will happen using neovim, then it will be loadable.

commented

I think neovim should be used to do any heavy lifting and anything that you would have to write yourself. I should be able to farm out ex commands to neovim so that it can run external programs for me and what not. Also, I should be able to have settings and keybindings in my vimrc and not have to reproduce them again in a much more verbose way in settings.json.

I can see how many plugins will be rather difficult to implement. Usually vim plugins add language support, autocompletion, snippets, file finding, etc and those are all provided already by the editor and the editor extensions. I think the most useful vim plugins to add here are those that provide movement/navigation help (vim-repeat, vim-surround, vim-commentary, targets, vim-easymotion).

In general, I would love to see more automatically included keybinding support for doing vscode operations in a vim-like way. For example, I should be able to open up the terminal or switch to/from the file finder using leader or g commands. Also, diffing within the editor is something common that I do in vim (diffthis, diffoff, etc)

@offero

I should be able to farm out ex commands to neovim so that it can run external programs for me and what not.

Starting from the next release, you'll be able to offload all ex commands (except a couple) to neovim. Just set enableNeovim to true.

Also, I should be able to have settings and keybindings in my vimrc and not have to reproduce them again in a much more verbose way in settings.json

This is currently part of the plan. The way I'm imagining this working is by having a command that will sync between the settings.json and your .vimrc.

I think the most useful vim plugins to add here are those that provide movement/navigation help (vim-repeat, vim-surround, vim-commentary, targets, vim-easymotion).

Even something like easymotion is non trivial to implement through neovim. Easymotion's labels don't have a direct translation to Vscode.

In general, I would love to see more automatically included keybinding support for doing vscode operations in a vim-like way. For example, I should be able to open up the terminal or switch to/from the file finder using leader or g commands.

I disagree about this one. Although we've added things like <c-w> h to navigate between windows, things like what you've said are better left to the user's own keybindings.

commented

My point about the keybinding support stems from the fact that when I use vscode even with the vim extension, my hand navigates to my mouse too much because I haven't been provided a natural/obvious way to perform some functions. Maybe it will just take more customization and learning on my part to get it all right and have a workflow where I don't have to go to the mouse any more.

When Vscode has an analogue for stuff that you can do in vim, like vsp or gt, we typically to implement it.

However, upon thinking about it some more, I think you might be right that we should implement some more vim like behavior.

Any places in particular where you find yourself using the mouse a lot?

commented

Any places in particular where you find yourself using the mouse a lot?

File navigation
New tabs, splitting, closing a tab/split
Opening/closing console and debug menus
Running test under cursor (tooltip links let you run them)
Running debug task
Ctrl-E/Y stop working when the cursor reaches the top/bottom of the visible editor window, so I use the scroll wheel after that.
Toggle breakpoint, stepping in debugging

I know these already have some keymaps that I just haven't become used to yet, but they aren't my vim maps...

Another extension I use a lot is BufKill (:BD) that allows me to close out the active buffer without closing the split.

I just want to do everything with ex commands and leader key sequences!

Integration of Neovim is very exciting news. Thank you for doing this!

What currently keeps me from using VSCode is its limited ability for window layouts, see microsoft/vscode#14909. Therefore, what I would like to see is that Neovim handles the buffers / splits within an editor window in VSCode.

@eglimi Unluckily, that's not likely to come in the near future. There's a fundamental difference between vscode windows/tabs and what they're capable of.

I've thought of how we might be able to embed neovim views into VSCode, but any work on that is still a long way off.

@GaryFurash Unluckily, VSCode's support for native dependencies is a bit lacking. See microsoft/vscode#6929

We might still do it (especially if we decide to make neovim a required dependency), but we need a bit of discussion (and more testing of neovim) on that front.

@Chillee my 2 cents:

  • Its good to have NeoVim integration for those who want it
  • NeoVim should never become a mandatory/required dependency
  • Optional is ok, depending on what that means. But it shouldn't mean a too-significant chunk of time/code will be spent on stuff that only benefits NeoVim users
  • NeoVim shouldn't be bundled with VScodeVim. Almost all systems have Vim already included. Why introduce needless complexity? What about people who don't use external commands at all? You'd just include a useless binary for them

All in all I'd say: create hooks for the people who use NeoVim thus giving them the possibility to do what they want, but develop for the system Vim. This strikes the perfect compatibility balance between NeoVim, Vim, and pure VScode users.

@JORVI Here are my thoughts:

  • I don't understand what you mean by "stuff that only benefits NeoVim users". If somebody can use neovim in vscodevim, then that benefits vscodevim users.
  • I don't understand your last point either. What does a system having vim already included have anything to do with including neovim? The idea behind Neovim integration is that we won't be limited to only Ex-commands: Ex-commands were only the beginning.

create hooks for the people who use NeoVim thus giving them the possibility to do what they want
That's also infeasible. Basically, if this extension is not integrating neovim, then neovim integration won't happen (unless it's an entirely new extension).

... but develop for the system Vim.
In general, you seem to be advocating for developing for Vim integration instead of Neovim. That is impossible. We are not using Neovim simply because it's fashionable or due to any personal preference, but because only Neovim has provided the API calls that are needed for integration.

As a side note, this github issue was created for feedback, so I'm going to clean up some of the help comments that are fixed or moved to another issue.

#1794

@Chillee

I don't understand what you mean by "stuff that only benefits NeoVim users". If somebody can use neovim in vscodevim, then that benefits vscodevim users.

That only benefits the subset of VScodeVim users that will use the feature(s) that engage NeoVim. See my next point.

In general, you seem to be advocating for developing for Vim integration instead of Neovim. That is impossible. We are not using Neovim simply because it's fashionable or due to any personal preference, but because only Neovim has provided the API calls that are needed for integration.

Yes, I am advocating for targeting Vim instead of NeoVim, because adding an external dependency is annoying. Making it mandatory is even worse, and including NeoVim, even for people who never use Ex-commands seems like unnecessary bloat. I can also see a future where there will be the choice: either implement a feature the easier way by making some calls to NeoVim, or the harder way by implementing it natively.. if the choice gets made that the easier road will be be taken, you've suddenly divided your userbase (NeoVim vs 'minimal' users).
On that note: wouldn't it be possible to use Vim's client-server mode to work some magic? It'd massively increase the reach of whatever extra stuff you develop.

commented

The entire premise of neovim is to provide a fast API to vim for integration with other editors.

@offero that's just plain wrong. The starting premise of NeoVim was async support, and the premise now is a cleaned-up version of the Vim codebase that allows for more extensibility of Vim. Nowhere does it say one of the explicit goals is to allow other editors to hook into NeoVim.

@VSCodeVim devs
To be clear: I'm not against exposing some NeoVim functionality to VScodeVim, I'm merely saying that most of your users will never use Ex-commands or NeoVim, and developer resources ( = time) are finite. Focusing those finite resources on developments that benefits all users vs. that only benefit the small subset of your users that will actually need to hook into NeoVim seems like a no-brainer to me. Likewise, not requiring a dependency for something only a small subset of your users needs seems again, a no-brainer, but ultimately it is your decision.

commented

@JORVI
From the homepage. 1 of 4 primary features. https://neovim.io/

First-class embedding
GUIs can nvim --embed or communicate via named pipe using the discoverable msgpack API.

From https://www.bountysource.com/teams/neovim/fundraiser

neovim
What you should know about neovim, if nothing else:
It will provide first class support for embedding.
It lets you extend the editor in any programming language.
It supports more powerful GUIs.

@offero damn.. I have no idea how I read over that. At any rate, I think I've advocated the native/minimalist viewpoint strongly enough, I'll shut up now and see where the discussion goes :)

@JORVI I agree: As it currently stands, it is probably a bad idea to bundle neovim in with the extension. However, we might potentially want to integrate more and more of neovim into VSCodeVim. The undo tree, .vimrc settings, actual support for vim plugins, fixing the long tail of bugs that come from subtle differences in how vim is implemented, etc.

If/when those features drop, they would require neovim as a dependency. And as such, we would have 3 options:

  • Force users to install neovim themselves (this is annoying, as you said)
  • Maintain both a non-neovim version and a neovim version (This is untenable as an open source project. One of the most limited resources open source projects have is developer time, and supporting 2 versions is not something I am willing to do)
  • Bundle neovim in as a dependency/ run an install script

The 3rd option seems like the best one to me.

Note: As I said earlier, vim is not suitable for providing an API around. If we want any of the features I listed above, they will have to come from neovim.

I think that there will be a point where this package becomes so integrated and dependent on neovim, that it will be required to have neovim as a dependency. At which point, there will be people that would prefer the "legacy" version without neovim support and someone in the community that wants this version can fork the project and maintain their own plugin. You should not be the one to have to maintain two versions.

I had never heard of Neovim until this latest update. Looking into it, it sounds like a good idea. I would like to suggest modifying the readme file a bit to help show people why you're encouraging a dependency. You could either borrow text from or link to the Neovim website where it gives a good reason as to why Neovim is worth my time installing. Another link I found helpful, but may not be as necessary is their vision.

I would like to share my perspective as a very happy vscode and VSCodeVim user. I wouldn't use vscode without VSCodeVim, and I am grateful for all your work.

I would like to second @JORVI's point that, at least for me, the VSCodeVim emulation is good enough, and I don't need all of vim's features to be happy. If I wanted all of vim's keybindings and support for custom plugins, I would use (neo)vim instead of vscode. But what I really want is vscode's awesome language plugin support and its modern GUI, and so that's why I use vscode.

I worry that integrating VSCodeVim with neovim will be a tricky project that might make the extension work less well. For example, it seems difficult to integrate neovim's undo tree with a potential vscode-native undo tree.

Whenever vscode tells me VSCodeVim has a new update, I am excited to see what vim shortcuts I can now also use in vscode. Though better ex commands is nice, I found the release notes for 0.8.2 concerning since I really don't want VSCodeVim to break, and that's what encouraged me to comment here.

I know this doesn't quite answer the question "what features from neovim integration would you guys like to see implemented first", but I hope it's useful feedback anyway. Thanks for the plugin.

I'm a vim neophyte and am not very familiar with neovim. So I'm not sure if I have any feedback intrinsic to the neovim functionality, except to ask perhaps for some kind of overview into the functionality added for us ignoramuses?

Also, I wholeheartedly agree with what @FelikZ said with argwrap above. This would be awesome. I've been doing a lot of TypeScript recently, and I use objects as params for named parameters among other reasons. I find myself hitting i enter caps(esc) 3 w and repeat to separate args line by line countless times throughout the day. I've thought of recording a macro, but the functionality in argwrap would be ideal.

Thanks for the awesome product! 👍

@jellevandenhooff I appreciate the feedback. Too often, open source projects only get comments from people wanting new features / unhappy with the current state of the project, when the vast majority of users are very happy with how the project is going.

We'll definitely try to prevent making any regressions as we continue to add improvements. That was an extraordinarily large update, and we pushed out fixes for the main breaking fixes within half a day.

commented

In general, I am all for simplicity and usability as well. I feel that plugins like vscodevim have to reimplement all of the functionality already provided through vim and make the plugin as vim-like as possible. Along the way, you have to fix bugs and tweak things that are simple vim features. I run into vscodevim bugs all the time. For instance, I just ran into a copy/paste from register bug where the register is overwritten if you paste from it. This is the kind of bug that wouldn't even show up if vim is being used under the hood because it's been thoroughly tested already.

If the neovim api doesn't fit well with the code, then I prefer to keep it simple and standalone. If neovim is a good fit, then I prefer to use it for as much as you possibly can.

I, too, am a happy VSCodeVim user. I wouldn't be able to use VSCode without this plugin, so thanks to the devs for all of their work to make our favorite new editor even better. Contention and dialogue are not bad in and of themselves, and your efforts are certainly appreciated.

I'm a long-time vim user but haven't tried neovim yet. It sounds like integrating will open up lots of possibilities, but I found the readme description disorienting. Neovim integration is good for developers, but it's the features that users care about. As a user, I don't know what "neovim integration for Ex-commands" gives me, but "Faster search and replace" sounds like something I want.

I see a few responses here echoing the sentiment that the change isn't well explained. I'd encourage you to focus on documenting from a feature perspective but making it clear which features require neovim.

  • Faster search and replace (requires neovim)
  • Full ex-mode support (required neovim)

As a user, I don't know what "neovim integration for Ex-commands" gives me

It means that we use NeoVim for ex commands. An "ex command" is the name in Vim for anything that happens after typing : and before enter in normal mode.

Could you suggest a better phrasing?

Sure, @johnfn. If I understand the feature correctly, I would phrase that as some variation on "Full ex-mode support (requires neovim)"

This feature is awesome! I am loving this integration so far. Makes using VScode much simpler.

One point of feedback I have so far: s/search/replace/cg should allow you to choose which instances you replace 😄

@ianks We can't do anything about that yet. When this gets implemented on the neovim side, neovim/neovim#6201, then we can add proper support :)

Well, we could add our own implementation, but I'd rather wait and solve it properly.

I've started work on some basic plugin/.vimrc support here: #1840 (it works for targets.vim!)

I might write up a document sometime soon about how I plan on integrating Neovim.

commented

set your "vim.neovimPath"

You need to clarify this to indicate WHAT you are supposed to set it to (the path to the nvim/nvim.exe executable.)

Some early work on a full rewrite based around neovim!

#1897

This doesn't support commands like ls that display a result using hit-enter, does it?

@leoj3n Unluckily, it doesn't. I wish it did. There's an issue somewhere on neovim for this, but it's kind of hard to keep track of this stuff :/

If it did, we could get things like s//gc to work, etc.

My answer might be a little late, but better later than never. ;)

First of all: I really love the work you are doing guys. VSCode would be absolutely useless without this great extension. There are some minor bugs or lack of functionality which I could work around pretty well and overall I am really satisfied so far.

I would not mind having nvim as a mandatory dependency, being it shipped with the extension or not.

@trippel Not at all! Neovim integration is a WIP, and any feedback is appreciated :)

THIS IS AMAZING!!! OMG! Can we have neovim read ~/.config/nvim/config.vimrc to autoload all settings and Plug extensions?

Edit: #1897 - huh. Awesome!

@Chillee I'm not sure if somebody has mentioned this before, but it would be awesome if you could integrate the terminal output from neovim into VS code. For example I have the fzf.vim plugin installed, and upon calling it it lists all files like this:

https://i.imgur.com/rniK0AC.png

Now, I know that fzf isn't necessary because of vs's integrated ctrl+p search, but I just gave it as an example.

@paxy97 I'm on mobile so I can't really check, but how does fzf display its output? Does it create a split and then use nvim's built in terminal?

Supporting stuff like this (also nerdtree /quickfix list) is something I'd like to do, but one problem is that we don't really have a good place to store this kind of output.

Also, development has now moved to https://github.com/chillee/vscodeneovim for development purposes, so please open issues there!

Note that there are a lot of bugs we're aware of that make it unsuitable as a daily driver, so please mainly open feature requests/suggestions.

@paxy97 So because we're syncing buffers, it kinda works? The highlighting doesn't match what it should be like in vim, it has to take up the whole page, etc. But the keybindings and stuff all work, so I guess if there's something you're really desperate for.

There's no really "good" way of displaying the UI though. We can't really customize splits nearly enough.

One thing I thought might be possible is displaying it in the built in terminal? I'm not really sure if that's possible though, nor desirable. So upon opening a buffer like the one for ctrl-p or NerdTree, the integrated terminal would pop up and the buffer would open in an instance of neovim in there.

I agree about the terminal that it's not a good idea. And opening it in a buffer isn't pretty either. But it's not that big of a deal for me, I'm happy as long as completion works :)

@paxy97 I think we'll probably be syncing it to some kind of neovim window for 3 main reasons: first, if vscode ever adds proper support for split control, then we'll be able to mimic it almost perfectly. Second, I think it's a cleaner solution than forcing vim to close every single one of those buffers. And finally, if you really need to have something like this (maybe undo tree) or something like that, it'll still work.

@FelikZ @offero So as it turns out, it is actually possible to offer full Easymotion support! There are some inherent limitations to the vim version that we don't necessarily have (like actually changing the buffer, as well as showing only matches on the screen), but I think it's still pretty cool.

Standard mapping (<leader><leader>w)

Doing map <Leader>L <Plug>(easymotion-bd-jk) and then <leader>L

@Chillee correct me if I am wrong. If I install latest neovim + easymotion plugin to it, then enable it in VSCode + will execute map <Leader>L <Plug>(easymotion-bd-jk), I will able to work with it in VSCode using <leader>L? All other easymotion's will be supported to?

@FelikZ With the fully neovim backed version, yes!

The only motions that won't really be supported (I think) are the overwin motions, I believe.

With the fully neovim backed version, yes!

New to this, can you point to where the fully neovim backed version lives ?

@davidovich Nowhere yet. It's still in development.

You can track the repo here https://github.com/Chillee/VSCodeNeovim

@paxy97 Thanks, this is what I meant by where. I understand that it is still in development, but having a where can help trying things out :-)

I'm experimenting the g command and m command, but doesn't work at all, I can get what I want in vim, so I think I typed command right, anyone idea?

p.s. I installed the latest neovim and did both the configuration, and didn't have warning pop up, so I think neovim is recognized by vscode

I also tried cgn and not work!. why?

This used to work, but I haven't been able to get any commands to work recently, on Windows or OSX. When I try anything more complicated than a 'move' command, I get E492: Not an editor command. <attempted command>. Interestingly, this is the same error message I get when trying a bad command inside of neovim, but these are for perfectly acceptable commands. Was nvim integrations inadvertently disabled recently?

@mattaschmann Sorry, there was a refactoring that introduced this bug. It was fixed in #2347.

I'll push out a release tonight.

I'm all for integration between VSCodeVim and an actual vim. the number of times I'm switched between vim, atom's vim integration and VSCodeVim and had things work subtly (or even completely) differently is insane. Things like block selections especially seem to work completely differently in all three and I'm left wondering what I'm doing wrong every time.

I have been trying to setup Neovim for Visual Studio Code:

"vim.enableNeovim": true,
"vim.neovimPath": "C:\Program Files\Neovim\bin\nvim.exe"

I have copied the neovimPath from the explorer to make sure it is correct and checked that Neovim can start. However, the path is underlined in the Workspace Settings to indicate an error and there is a message when I restart VSCode,:
"Unable to etup neovim instance. Check your path".

OS: Windows 7 32 bit
VSCode version: 1.22.2
Neovim version: 0.2.2

Any ideas about what could be wrong?

hi all!

have same issue as @Orionsg! I have tried to integrate neovim into vscode (under macos) couple of times and failed to do that. would be nice to have/come up with latest howto on that.

ready to put some efforts into that

@ZuBB @Orionsg I believe you should escape the \ in path like this: D:\\Program Files\\Neovim\\bin\\nvim.exe.

hey @DrakeXiang, thanks for reply.

I am on mac os x 10.13. unix uses next kind of slash/. I thought I do not need to escape it. also a hint (provided by vscode) says same /usr/....

@DrakeXiang, thanks using extra backslashes escaping the backslash got rid of the error!

Replace command (current line and next lines) dosen't work?

ex) :.,+1s/foo/bar

VSCodeVim : 0.13.1
VSCode : 1.24.1
NeoVim : v0.30

Vertical blocks have many issues. When marking a vertical block with ctrl-v:

  1. Yanking the block and pasting it (p) somewhere else inserts the block of text as if it is a normal block with new line characters rather than pasting the block at the column position where the cursor is (for each line in the vertical block).

  2. Deleting the vertical block (d) does not copy the contents to the buffer so it can afterwards be pasted (p).

  3. One cannot move the marked vertical block to the left or right with "<" or ">", respectively.

VSCode: 1.24.1
VSCodeVim: 0.14.1
NeoVim: 0.2.2

Using ":norm @@" command, the NeoVim macros are used, instead VSCode macros.

VSCode: 1.25
VSCodeVim: 0.14.2
NeoVim: 0.2.2

@dgaleazzo yeah, I have the same problem. Being able to record a macro and apply it to multiple lines is a killer-feature of vim's :normal command, but with the current neovim integration it doesn't work.

This generally seems excellent - the main thing I've noticed is that :help replaces file contents :(

I just started getting a weird bug where I can't escape from insert or visual mode. Esc doesn't do anything and Ctrl + [ just unindents the line. Turning neovim off fixes the problem.

Using Neovim crashes my VS Code. If I use any Ex-commands it freezes my editor window. I documented this a while ago: #3013

VSCode: 1.25
VSCodeVim: 0.16.9
NeoVim: 0.3.1

It’s reliable for me on Mac, but have similar freezing issues on Windows

Most likely Nvim is waiting for input. Does vscodevim check nvim_get_mode to see if it's in this state ("blocking" flag)? (This is a question for @Chillee or anyone who can inspect VSCode source code.)

Most likely Nvim is waiting for input. Does vscodevim check nvim_get_mode to see if it's in this state ("blocking" flag)?

How do I check this? Here is my log output under Output > Log (Extension Host): https://gist.github.com/jplew/35155adb2e1ff993f2fde9dca7efdbb8

No mention of nvim there.


UPDATE: I fixed it, i had a corrupted main.shada file: #3013

Word boundary pattern \< in visual range selection is not working.

command:
:'<,'>s/\<bar\>/baz/g
What I received:
E486: Pattern not found: \/baz

VSCode: 1.29.1
VSCodeVim: 0.16.12
NeoVim: 0.3.1

I have the same problem as @jplew described here.
Removing the main.shada file and ~/.vimrc didn't solve the issue, though. NeoVim doesn't show any error on startup. I've looked through the logs in VSCode but didn't see anything suspicious. Any idea what it could be?

VSCode: 1.30.1
vscodevim: v1.0.0 (2019-01-05)
NVIM: v0.3.3
MacOS: 10.14.1

@andersennl sounds similar to #3323. Fixed was merged by @xconverge with a new release including said fix coming soon in v1.0.1

@jpoon v.1.0.1 fixed the issue. Thanks!

hi!!, i've been testing the integration and I have couple of questions:

  1. where I can find the output when running commands? example :!ls -ltr. When executing things, the prompt just returns to "normal mode" and i'm unable to see the output anywhere.
  2. in insert mode, although ctrl-x ctrl-l does work for me, ctrl-x ctrl-f for file/directory completion does not, is this feature supported?
    thank you!

I copy my settings.json between machines. Is there a way to define declare neovimPath differently for linux and windows?

I hope the neovim integration can use the style as what oni do, when input ":" "/".
https://www.onivim.io/

What about the echo command? and the source command?
I feel like it could exploit at least half of the potential of neovim, but it doesn't currently.

@eyalk5 Nvim 0.4.0 (unstable/development version) introduced the ext_messages UI API for that purpose. In case any VSCodeVim contributor wants to add support for that.

:help ui-options

OK, I am not sure I fully understand(after installing this version) what does it mean. But I am glad it will be implemented. In any case, the lack of response for some commands that either fail or succeed is a major problem currently. And of course, supporting the defined keyboard mapping inside nvim is essential. This way my beloved customizations (in vimrc) could be applied. I might try to help to implement this.

I can't set up neovim integration successfully.
I received message:

Configuration: Invalid neovimPath. spawn /usr/bin/nvim ENOENT.

I have already added "vim.enableNeovim": true and "vim.neovimPath": "/usr/bin/nvim" to my settings.json, and checked that nvim indeed is located in /usr/bin/

VSCode version: 1.36.1
OS: Linux Mint 19.1
VSCodeVim: 1.9.0
NeoVim: 0.3.8

I can't set up neovim integration successfully.
I received message:

Configuration: Invalid neovimPath. spawn /usr/bin/nvim ENOENT.

I have already added "vim.enableNeovim": true and "vim.neovimPath": "/usr/bin/nvim" to my settings.json, and checked that nvim indeed is located in /usr/bin/

VSCode version: 1.36.1
OS: Linux Mint 19.1
VSCodeVim: 1.9.0
NeoVim: 0.3.8

I figured out this error is caused by flatpak's sandbox feature, tried to give additional options to flatpak to run VSCode but got no luck. I switch to VSCodium, which is a branch of VSCode, and also distributed without flatpak option. And It's all work now.

EDIT: Add Microsoft VSCode ppa from these instructions, then install from package manager, the VSCode is also non-flatpak, dont't know how I get a flatpak version VSCode :P

I can't set up neovim integration successfully.
I received message:

Configuration: Invalid neovimPath. spawn /usr/bin/nvim ENOENT.

I have already added "vim.enableNeovim": true and "vim.neovimPath": "/usr/bin/nvim" to my settings.json, and checked that nvim indeed is located in /usr/bin/

VSCode version: 1.36.1
OS: Linux Mint 19.1
VSCodeVim: 1.9.0
NeoVim: 0.3.8

Same problem with vscode remote ssh. I installed nvim on my remote linux server, but this error keeps me from using neovim intergration.

@CavalloneChen Is your vscode flatpak version?

@CavalloneChen Is your vscode flatpak version?

Honestly I don't know. I'm using the build downloaded from Vscode's official website.

@CavalloneChen Is your vscode flatpak version?

Honestly I don't know. I'm using the build downloaded from Vscode's official website.

Execute flatpak list in terminal, and check if there is a line like this com.visualstudio.code

================================

I guess you download a .deb file from the visual studio code website, that's how I get a flatpak version vscode. I uninstalled the flatpak version vscode first, and manually add package repository then install vscode from package manager.
( referenced from here: https://code.visualstudio.com/docs/setup/linux )

I copied the installation commands for you:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code

P.S.
Commands uninstall the flatpak version vscode:

flatpak uninstall <the vscode name shown in 'flatpak list', e.g.  com.visualstudio.code.oss>

@CavalloneChen Is your vscode flatpak version?

Honestly I don't know. I'm using the build downloaded from Vscode's official website.

Execute flatpak list in terminal, and check if there is a line like this com.visualstudio.code

================================

I guess you download a .deb file from the visual studio code website, that's how I get a flatpak version vscode. I uninstalled the flatpak version vscode first, and manually add package repository then install vscode from package manager.
( referenced from here: code.visualstudio.com/docs/setup/linux )

I copied the installation commands for you:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code

P.S.
Commands uninstall the flatpak version vscode:

flatpak uninstall <the vscode name shown in 'flatpak list', e.g.  com.visualstudio.code.oss>

Thanks for your explanations, I really appreciate your effort. I found that I made a fundamental mistake. I pointed the neovim path to the neovim installed on my remote machine, but the local neovim path should be pointed instead. My problem was solved after I changed to the local path.

I am perfectly happy with current vscodevim as far as my current knowledge of vim goes, great job.
Yet to be honest I'm a bit surprised you're trying to implement vim and neovim emulation into vscode natively, wouldn't it be easier (but also better for long-term maintenance) to connect to full neovim through server mode and basically have neovim do all the work for you, so that you're not really emulating [neo]vim, you're actually using it, just with vscode as frontend?
Or have I misinterpreted what's currently possible through neovim APIs?

By the way, for those that oppose this "because minimalism", I would note that baking neovim's functionalities into vscodevim doesn't make it any lighter than bundling neovim with it (the code's getting in either way), nor any simpler for the user (as long as it's installed automatically with it). It only makes it harder for the devs that maintain the plugin.

@Mirag-e There is a project to do just this (https://github.com/Chillee/VSCodeNeovim) but it's been dead for a while. You might find https://github.com/onivim/oni2 interesting also.

thanks for the pointers, oni2 seems super interesting, though i'm a bit sad it's not fully open source. I guess that's the price to pay when you don't have microsoft paying your main developers.

I wish VSCodeNeovim was active. I'd work on it myself if I have the time, but, alas...

Ex commands may be useful, but I've never actually used them. The VSCodeVim plugin seems to work well a lot of the time, but I find it to be a bit finicky sometimes, which is why I personally would love to see neovim power it.

Oni2 looks super interesting, since they intend to support vscode extensions and configuration... and for $20, I don't mind speculating that the project will work out. Time will tell.

Oni2 looks super interesting, since they intend to support vscode extensions and configuration... and for $20, I don't mind speculating that the project will work out. Time will tell.

I'm not trying to discourage you to support this cool project. Just FYI after using Oni (1) I dropped it fairly quickly. (it was finicky about what neovim versions I had installed and it was buggy)

Oni2 looks super interesting, since they intend to support vscode extensions and configuration... and for $20, I don't mind speculating that the project will work out. Time will tell.

I'm not trying to discourage you to support this cool project. Just FYI after using Oni (1) I dropped it fairly quickly. (it was finicky about what neovim versions I had installed and it was buggy)

Thanks for the heads up. It seems they've taken a different approach with Oni2 though, using libvim instead of neovim. I read somewhere that the choice was because of integration issues with neovim.

You may already know this, but it seems like if you have supported Oni1, you will have access to Oni2 https://onivim.github.io/docs/other/faq#i-already-backed-onivim-1-do-i-need-to-pay-again so hopefully your support for Oni1 will be worth it if Oni2 is successful.

I installed Neovim and set it active in order to be able to use regular expressions in the substitute command. However, it does not seem to work for the substitute or global command.

If I use:

":%s/^/<p>/g" (to insert a p tag in the beginning of all lines)
or
":g/^\s*$/d" (to remove all blank lines)

I get the error:
"TaskQueue: Error running task. Failed to handle key= . nvim_buf_set_lines: Wrong type for argument 1, expecting Buffer."

Any ideas about how to make this work?

I installed Neovim and set it active in order to be able to use regular expressions in the substitute command. However, it does not seem to work for the substitute or global command.

If I use:

":%s/^/<p>/g" (to insert a p tag in the beginning of all lines)
or
":g/^\s*$/d" (to remove all blank lines)

I get the error:
"TaskQueue: Error running task. Failed to handle key= . nvim_buf_set_lines: Wrong type for argument 1, expecting Buffer."

Any ideas about how to make this work?

+1 @Orionsg This feature had been working for me for quite some time but it has been broken recently :/ Similar error message about nvim_buf_set_lines tried upgrading neovim to no avail. I'm thinking it's a bug.

commented

One thing I miss is netrw being able to open a url with gx is really nice.