I am using Neovim v0.7.2 and I am looking for a way to have autocomplete for my Neovim. Since it's suggested that we should use Metals for Scala in Neovim. After installing it, I could use its features but it seems does not support autocomplete as Intellij IDEA does. Any suggestions/recommendations for me or do I miss any part when configuring Metals with Neovim? Thank you!
SOLVED: I found the problem and post the answer below. In short, follow the example in https://github.com/scalameta/nvim-metals/discussions/39
I miss the installation of nvim-cmp. The example in https://github.com/scalameta/nvim-metals/discussions/39 works perfectly.
Related
I run vscode version 1.65.2.
Today it started citing the whole "The Zen of Python" in the terminal window every time I run a python script in the debugger.
EDIT: It turns out that it is the python interpreter that does it, not vscode. The problem apparently came after I updated ipykernel to version 6.11.0. I run python version 3.9.1 on Windows.
How can I turn it off?
I havent been able to find an answer to this anywhere.
It turned out that an import statement had found its way into my code: "import this as d", and removing it solved the problem. It is a mystery how it ended up there, I certainly haven't put it there knowingly. But problem solved!
That's really odd. I just had the exact same thing. Even the import this as d was on the first line before everything. I use vscode as well. Removing it does help. But I didn't update a kernel prior to this. It happened while I was writing code I think. Python 3.8.10 on Linux.
I encountered this link: https://learn.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2019, and I was thinking to follow it to generate code maps for my c++ code running on ubuntu vs code of version 1.61.2. Somehow I can not even find the tool menu and the solution explorer. I managed to install the solution explorer as my VS code extension. But I still do not know how to get started. Any comments are greatly appreciated.
Unfortunately it seems that the dependency maps are only available in Visual Studio and not in VSCode, which are two separate things
I wanted to try vim for a bit, and get used to it... i got stuck with trying to replicate Ctrl+D functionality of VScode... so I've tried couple Google solutions.
This is What I've tried when I got that error:
:g/oldword/norm newword
I see lots of people do search patterns like this, but it's annoying I get this message, without being able to find solution on google :D
I know I can solve this issue with /word then cgn newword and then just repeat with . operator, BUT, I want to be able to use the global command for searching patterns and stuff, for other purposes too, and it stresses me out that I can't make it work!
Here is the error I am getting.
Any help is extremely appreciated / welcome! Thanks.
Edit: Forgot to mention: We are talking about Vim for VScode, not the gvim installation stuff. Will try to install that too, and update the question.
Edit2: Okay so apparently, after instalilng gvim (from official site) and ran it through vim command in cmd prompt, the official vim can run the :g commands.
Like (for example) if you want to search for <a> and replace it with <router-link> you can do so by: :g/<a>/norm ciw<router-link>
Which means:
:g/<a>/norm run a global (file) search for pattern <a>
ciw - change in word
<router-link> the replacement pattern for <a>
Note: The same should be done for </a> after that :D
The problem still exists tho.
While the native vim exe (outside of vscode) works and can run these stuffs, I still need to fix the vscode one (the extension that is). It is defo nice to have syntax highlighting and correction.
What you are using is not Vim. It is a Vim emulator which, like all Vim emulators, can't be expected to be either complete or accurate. Its only relationship with Vim is that it tries and fails to imitate it.
Some of the Vim stuff you will find on the internet will work in that VSCode extension exactly as it does in Vim, some of it will work but partially or differently, and most of it, like :g, will simply not work.
There is nothing you can do about that except, maybe, contributing to the project.
If you want support for the global command in VSCode, install Neovim and the VSCode extension for it:
for those who expected this to work but it doesn't, it's possibly because you need to have installed neovim (firstly) and then vscode-neovim extension (secondly) https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim
Source: https://github.com/VSCodeVim/Vim/issues/2346
The easiest way to get this working is to enable neovim in the VS Code Vim extension you're using.
Once you have installed Neovim on your operating system, you can enable it within VSCode inside the Preferences: User Settings window:
Enable the Vim: Enable Neovim option (vim.enableNeovim)
Set the path to Neovim inside the Vim: Neovim Path setting (vim.neovimPath)
Restart VSCode
Source: https://www.barbarianmeetscoding.com/boost-your-coding-fu-with-vscode-and-vim/integrating-vscode-with-neovim/#enabling-neovim-inside-vscode
Currently a (neo)vim user, I read that VS Code supports neovim backend integration, but after searching I cannot find how to set it up.
Can someone explains how to set up neovim integration in VS Code?
Thank you.
PS : I use both linux and windows so if there are some OS specifity you could mention it.
I believe the integration you read about was referring the neovim integration in VSCodeVim: https://github.com/VSCodeVim/Vim#neovim-integration
This one uses a real instance of neovim as editor back-end: https://github.com/asvetliakov/vscode-neovim
I started to use vscode for python development. And I really like it, does anyone know how to extend VScode so I can write scala in it as well ?
At the bare minimum I need to get syntax highlighting working.
Scala works well in VS Code 2019.
There's official syntax highlighting, and a Language Server called Metals (which replaces Ensime which is mentioned in other answers).
There is one here:
https://github.com/IliyaTryapitsin/vscode-scala
You can add it by reading the readme there which is:
Run VSCode
code --enableExtensionGallery
Press F1 then input:
for scala installation
ext install scala
for sbt installation
ext install sbt
for snippets installation
ext install scalasnippets
If your NOT using Intellij or Eclipse and want to stick to VSCode, then I highly recommend Ensime & Ensime plugin below:
https://marketplace.visualstudio.com/items?itemName=dragos.scala-lsp
Also check out, www.ensime.org
It's a bit more involved to setup ensime env but still worth it.
Discussion of two is below here:
https://www.reddit.com/r/scala/comments/5eu9if/intellij_vs_ensime/
However, Intellij has improved a lot. So, the beauty contest is a matter of judgement call.
I have been switch back & forth between many variations (Emacs, Intellij, neovim, VSCode). It's a complicated language. So, I need all the help I can get!
If you dig into the applications path it looks to me to be extensible in .js, take a look at the javascript and typescript folders for example(though I haven't tried it yet)
Visual Studio Code does not have a language extensible story yet, but it could be coming soon.
https://code.visualstudio.com/Docs/languages#_common-questions
scala has official vs code scala extension