if not vim.g.vscode then return {} end local Config = require("lazy.core.config") local Plugin = require("lazy.core.plugin") local vscode = require("vscode-neovim") local map = vim.keymap.set -- Add any additional plugins in vscode, you can set vscode=true on a plugin spec. local enabled = { "flash.nvim", "lazy.nvim", "dial.nvim", "mini.align", "nvim-recorder", "comment-box.nvim", "text-case.nvim", "mini.ai", "mini.comment", "mini.pairs", "mini.surround", "nvim-treesitter", "wildfire.nvim", "nvim-treesitter-textobjects", "nvim-various-textobjs", "nvim-ts-context-commentstring", "vim-repeat", "vim-carbon-now-sh", "highlight-undo.nvim", "ts-node-action", "LazyVim", } 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.opt.timeoutlen = 0 -- To show whichkey without delay vim.notify = vscode.notify vim.g.clipboard = vim.g.vscode_clipboard local function vscode_action(cmd, opts) return function() vscode.action(cmd, opts) end end -- Add some vscode specific keymaps vim.api.nvim_create_autocmd("User", { pattern = "LazyVimKeymaps", callback = function() -- view problems map("n", "xx", vscode_action("workbench.actions.view.problems")) -- open file explorer map("n", "e", vscode_action("workbench.view.explorer")) -- toggle side bar map("n", "ue", vscode_action("workbench.action.toggleSidebarVisibility")) -- terminal map("n", [[]], vscode_action("workbench.action.terminal.toggleTerminal")) map("n", "fts", vscode_action("workbench.action.terminal.newWithCwd")) -- working with editors (buffers) map("n", "bo", vscode_action("workbench.action.closeOtherEditors")) map("n", "bA", vscode_action("workbench.action.closeAllEditors")) map("n", "ba", vscode_action("workbench.action.lastEditorInGroup")) map("n", "bf", vscode_action("workbench.action.firstEditorInGroup")) map("n", "bl", vscode_action("workbench.action.closeEditorsToTheLeft")) map("n", "br", vscode_action("workbench.action.closeEditorsToTheRight")) map("n", "H", vscode_action("workbench.action.previousEditorInGroup")) map("n", "L", vscode_action("workbench.action.nextEditorInGroup")) map("n", "bd", vscode_action("workbench.action.closeActiveEditor")) map("n", "", vscode_action("workbench.action.showMultipleEditorTabs")) map("n", "", vscode_action("workbench.action.showEditorTab")) -- breakpoints map("n", "", vscode_action("editor.debug.action.toggleBreakpoint")) -- windows map("n", "|", vscode_action("workbench.action.splitEditorRight")) map("n", "-", vscode_action("workbench.action.splitEditorDown")) -- LSP actions map("n", "ca", vscode_action("editor.action.codeAction")) map("n", "gy", vscode_action("editor.action.goToTypeDefinition")) map("n", "gr", vscode_action("editor.action.goToReferences")) map("n", "gi", vscode_action("editor.action.goToImplementation")) map("n", "K", vscode_action("editor.action.showHover")) map("n", "cr", vscode_action("editor.action.rename")) map("n", "co", vscode_action("editor.action.organizeImport")) map("n", "cf", vscode_action("editor.action.formatDocument")) map("n", "ss", vscode_action("workbench.action.gotoSymbol")) map("n", "sS", vscode_action("workbench.action.showAllSymbols")) -- refactor map("n", "cR", vscode_action("editor.action.refactor")) -- markdown preview map("n", "cp", vscode_action("markdown.showPreviewToSide")) -- project manager map("n", "fp", vscode_action("projectManager.listProjects")) -- zoxide -- stylua: ignore map("n", "fz", vscode_action("terminalCommandKeys.run", { args = { cmd = "cdzc", newTerminal = false, saveAllFiles = false, showTerminal = true, focus = true } } )) -- zen mode map("n", "z", vscode_action("workbench.action.toggleZenMode")) -- cspell map("n", "!", vscode_action("cSpell.addWordToDictionary")) map("n", "us", vscode_action("cSpell.toggleEnableSpellChecker")) -- comments map("n", "xt", vscode_action("workspaceAnchors.focus")) -- git map("n", "gg", vscode_action("gitlens.views.home.focus")) map("n", "ub", vscode_action("gitlens.toggleFileBlame")) map("n", "]h", function() vscode.action("workbench.action.editor.nextChange") vscode.action("workbench.action.compareEditor.nextChange") end) map("n", "[h", function() vscode.action("workbench.action.editor.previousChange") vscode.action("workbench.action.compareEditor.previousChange") end) -- statusline map("n", "uS", vscode_action("workbench.action.toggleStatusbarVisibility")) -- markdown preview map("n", "cp", vscode_action("markdown.showPreviewToSide")) -- codeium map("n", "cI", vscode_action("codeium.toggleEnable")) map({ "n", "v" }, "id", vscode_action("codeium.generateFunctionDocstring")) map("n", "ic", vscode_action("codeium.openChatView")) map("n", "is", vscode_action("codeium.openSearchView")) map({ "n", "v" }, "ie", vscode_action("codeium.explainCodeBlock")) map({ "n", "v" }, "iE", vscode_action("codeium.explainProblem")) map({ "n", "v" }, "ii", vscode_action("codeium.openCodeiumCommand")) -- diagnostics map("n", "]d", vscode_action("editor.action.marker.next")) map("n", "[d", vscode_action("editor.action.marker.prev")) -- whichkey map("n", "", vscode_action("whichkey.show")) -- search map("n", "", "Find") map("n", "ff", "Find") map("n", "/", vscode_action("workbench.action.findInFiles")) map("n", "sg", vscode_action("workbench.action.findInFiles")) map("n", "sc", vscode_action("workbench.action.showCommands")) -- format map("n", "cf", vscode_action("editor.action.formatDocument")) -- ui map("n", "uC", vscode_action("workbench.action.selectTheme")) 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, }, }, }, { "folke/flash.nvim", init = function() local palette = require("catppuccin.palettes").get_palette("macchiato") local bg = palette.none vim.api.nvim_set_hl(0, "FlashBackdrop", { fg = bg }) vim.api.nvim_set_hl(0, "FlashLabel", { fg = palette.green, bg = bg, bold = true }) vim.api.nvim_set_hl(0, "FlashMatch", { fg = palette.lavender, bg = bg }) vim.api.nvim_set_hl(0, "FlashCurrent", { fg = palette.peach, bg = bg }) end, }, }