diff --git a/.config/nvim/lua/plugins/extras/util/vscode.lua b/.config/nvim/lua/plugins/extras/util/vscode.lua index 788f88fe..d99e7332 100644 --- a/.config/nvim/lua/plugins/extras/util/vscode.lua +++ b/.config/nvim/lua/plugins/extras/util/vscode.lua @@ -2,7 +2,9 @@ if not vim.g.vscode then return {} end -vim.o.spell = false +local Config = require("lazy.core.config") +local Plugin = require("lazy.core.plugin") +local vscode = require("vscode-neovim") -- Add any additional plugins in vscode, you can set vscode=true on a plugin spec. local enabled = { @@ -14,19 +16,31 @@ local enabled = { "mini.surround", "nvim-treesitter", "nvim-treesitter-textobjects", + "nvim-various-textobjs", "nvim-ts-context-commentstring", "vim-repeat", + "yanky.nvim", + "highlight-undo.nvim", + "multicursors.nvim", "LazyVim", } -local Config = require("lazy.core.config") -local Plugin = require("lazy.core.plugin") Config.options.checker.enabled = false Config.options.change_detection.enabled = false Config.options.defaults.cond = function(plugin) return vim.tbl_contains(enabled, plugin.name) or plugin.vscode end +vim.o.spell = false +vim.notify = vscode.notify +vim.g.clipboard = vim.g.vscode_clipboard + +local function vscode_action(cmd) + return function() + vscode.action(cmd) + end +end + -- Add some vscode specific keymaps vim.api.nvim_create_autocmd("User", { pattern = "LazyVimKeymaps", @@ -34,17 +48,17 @@ vim.api.nvim_create_autocmd("User", { -- find file vim.keymap.set("n", "", "Find") -- find in files - vim.keymap.set("n", "/", [[call VSCodeNotify('workbench.action.findInFiles')]]) + vim.keymap.set("n", "/", vscode_action("workbench.action.findInFiles")) -- open symbol - vim.keymap.set("n", "ss", [[call VSCodeNotify('workbench.action.gotoSymbol')]]) + vim.keymap.set("n", "ss", vscode_action("workbench.action.gotoSymbol")) -- view problems - vim.keymap.set("n", "xx", [[call VSCodeNotify('workbench.actions.view.problems')]]) + vim.keymap.set("n", "xx", vscode_action("workbench.actions.view.problems")) -- open file explorer in left sidebar - vim.keymap.set("n", "e", [[call VSCodeNotify('workbench.view.explorer')]]) + vim.keymap.set("n", "e", vscode_action("workbench.view.explorer")) -- Code Action - vim.keymap.set("n", "ca", [[call VSCodeNotify('editor.action.codeAction')]]) + vim.keymap.set("n", "ca", vscode_action("editor.action.codeAction")) -- Open terminal - vim.keymap.set("n", "ft", [[call VSCodeNotify('workbench.action.terminal.focus')]]) + vim.keymap.set("n", "ft", vscode_action("workbench.action.terminal.focus")) end, }) @@ -60,6 +74,10 @@ return { }, { "nvim-treesitter/nvim-treesitter", - opts = { highlight = { enable = false } }, + opts = { + highlight = { + enable = false, + }, + }, }, }