From a5514009ea67310b0c6e2ebe5aba5680b8e295a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20G=C3=B6k=C3=A7in?= Date: Tue, 10 Dec 2024 09:34:28 +0100 Subject: [PATCH] feat(vscode): add vscode-specific keymaps and sync undo/redo with vscode - synced undo/redo lists with vscode using `vscodenotify` - enabled navigation of vscode tabs similar to lazyvim buffers --- lua/lazyvim/plugins/extras/vscode.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index e941d91c..e32069c7 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -33,9 +33,18 @@ end vim.api.nvim_create_autocmd("User", { pattern = "LazyVimKeymapsDefaults", callback = function() + -- VSCode-specific keymaps for search and navigation vim.keymap.set("n", "", "Find") vim.keymap.set("n", "/", [[lua require('vscode').action('workbench.action.findInFiles')]]) vim.keymap.set("n", "ss", [[lua require('vscode').action('workbench.action.gotoSymbol')]]) + + -- Keep undo/redo lists in sync with VsCode + vim.keymap.set("n", "u", "call VSCodeNotify('undo')") + vim.keymap.set("n", "", "call VSCodeNotify('redo')") + + -- Navigate VSCode tabs like lazyvim buffers + vim.keymap.set("n", "", "call VSCodeNotify('workbench.action.previousEditor')") + vim.keymap.set("n", "", "call VSCodeNotify('workbench.action.nextEditor')") end, })