diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index 1f333e7f..489182e5 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -66,6 +66,7 @@ "plugins.extras.util.bigfile", "plugins.extras.util.discordrcp", "plugins.extras.util.icon-picker", + "plugins.extras.util.vscode", "plugins.extras.util.wakatime" ], "news": { diff --git a/.config/nvim/lua/plugins/extras/util/vscode.lua b/.config/nvim/lua/plugins/extras/util/vscode.lua new file mode 100644 index 00000000..6841c92e --- /dev/null +++ b/.config/nvim/lua/plugins/extras/util/vscode.lua @@ -0,0 +1,63 @@ +if not vim.g.vscode then + return {} +end + +-- Add any additional plugins in vscode, you can set vscode=true on a plugin spec. +local enabled = { + "flash.nvim", + "lazy.nvim", + "mini.ai", + "mini.comment", + "mini.pairs", + "mini.surround", + "nvim-treesitter", + "nvim-treesitter-textobjects", + "nvim-ts-context-commentstring", + "vim-repeat", + "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 + +-- Add some vscode specific keymaps +vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimKeymaps", + callback = function() + -- find file + vim.keymap.set("n", "", "Find") + -- find in files + vim.keymap.set("n", "/", [[call VSCodeNotify('workbench.action.findInFiles')]]) + -- open symbol + vim.keymap.set("n", "ss", [[call VSCodeNotify('workbench.action.gotoSymbol')]]) + -- view problem + vim.keymap.set("n", "xx", [[call VSCodeNotify('workbench.actions.view.problems')]]) + -- open file explorer in left sidebar + vim.keymap.set("n", "e", [[call VSCodeNotify('workbench.view.explorer')]]) + -- Code Action + vim.keymap.set("n", "ca", [[call VSCodeNotify('editor.action.codeAction')]]) + -- Open terminal + vim.keymap.set("n", "ft", [[call VSCodeNotify('workbench.action.terminal.focus')]]) + end, +}) + +return { + { + "LazyVim/LazyVim", + config = function(_, opts) + opts = opts or {} + -- disable the colorscheme + opts.colorscheme = function() end + require("lazyvim").setup(opts) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { highlight = { enable = false } }, + }, +}