Using lazy.nvim in VSCode on Windows
I've been using VSCode Neovim for a while, but had been irritated at the tradeoff of access to the VSCode ecosystem at the cost of losing my once-heavily curated .vimrc
setup. Turns out you don't have to live that way!
A lot of doing dev work on Windows feels like making a Rube Goldberg machine to make it behave more like Linux, and this is not particularly different, but I do wish I'd moved faster to replicate my preferred IDE setup in VSCode. You really can have your cake and eat it too, sort of. Some stuff doesn't work the way it would in nvim directly, but there are enough pros to integrating with VSCode that I think it ends up balancing out.
To set up lazy.nvim, start by creating an init.lua
file somewhere - the default folder for neovim on windows is AppData/Local/nvim
but you can put your init file anywhere you want. Just copy that path and paste it into VSCode Neovim's settings:

vscode-neovim.neovimInitVimPaths.win32
: {my init.lua path}
In init.lua
:
require("config.lazy")
Now, in AppData/Local/nvim
, create the following structure:
lua
|---config
|----------lazy.lua
|---plugins
|----------base.ua
In lazy.lua
, copy the default setup for lazy.nvim
(copied and pasted directly from their install instructions):
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
}
And in plugins/init.lua
, include your vim plugins of choice (I like Tim Pope, what can I say?):
return {
'tpope/vim-repeat',
'tpope/vim-surround',
'tpope/vim-sensible',
'tpope/vim-unimpaired',
'tpope/vim-repeat',
'tpope/vim-commentary',
}
In VSCode Neovim, you may want to enable logging output to the console:

Restart VSCode - if you have any problems, it should be logged directly to "output" in the terminal, but for me at least, this setup worked without issue.