Skip to content

Commit

Permalink
feat(recipes): add vscode-neovim support
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Mar 1, 2024
1 parent ae183d6 commit 7d92da2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/recipes/vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# VS Code Integration Support

**Website:** <https://docs.astronvim.com/recipes/vscode>

Some users may be wanting to integrate their Neovim configuration with their VS Code editor. This spec configures AstroNvim to play nicely with the VS Code Plugin [`vscode-neovim`](https://github.com/vscode-neovim/vscode-neovim).
56 changes: 56 additions & 0 deletions lua/astrocommunity/recipes/vscode/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
if not vim.g.vscode then return {} end -- don't do anything in non-vscode instances

-- a list of known working plugins with vscode-neovim
local enabled = vim.tbl_add_reverse_lookup {
-- core plugins
"lazy.nvim",
"AstroNvim",
"astrocore",
"astroui",
"Comment.nvim",
"nvim-autopairs",
"nvim-treesitter",
"nvim-ts-autotag",
"nvim-treesitter-textobjects",
"nvim-ts-context-commentstring",
-- more known working
"flash.nvim",
"flit.nvim",
"leap.nvim",
"mini.ai",
"mini.comment",
"mini.surround",
"vim-easy-align",
"vim-repeat",
"vim-sandwich",
-- feel free to open PRs to add more support!
}

local Config = require "lazy.core.config"
-- disable plugin update checking
Config.options.checker.enabled = false
Config.options.change_detection.enabled = false
-- replace the default `cond`
Config.options.defaults.cond = function(plugin) return enabled[plugin.name] end

---@type LazySpec
return {
-- add a few keybindings
{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
["<Leader>ff"] = "<CMD>Find<CR>",
["<Leader>fw"] = "<CMD>call VSCodeNotify('workbench.action.findInFiles')<CR>",
["<Leader>ls"] = "<CMD>call VSCodeNotify('workbench.action.gotoSymbol')<CR>",
},
},
},
},
-- disable colorscheme setting
{ "AstroNvim/astroui", opts = { colorscheme = false } },
-- disable treesitter highlighting
{ "nvim-treesitter/nvim-treesitter", opts = { highlight = { enable = false } } },
}

0 comments on commit 7d92da2

Please sign in to comment.