local keymap = vim.keymap.set local opts = { noremap = true, silent = true } -- remap leader key keymap("n", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " -- yank to system clipboard keymap({"n", "v"}, "y", '"+y', opts) -- paste from system clipboard keymap({"n", "v"}, "p", '"+p', opts) -- better indent handling keymap("v", "<", "", ">gv", opts) -- move text up and down keymap("v", "J", ":m .+1==", opts) keymap("v", "K", ":m .-2==", opts) keymap("x", "J", ":move '>+1gv-gv", opts) keymap("x", "K", ":move '<-2gv-gv", opts) -- paste preserves primal yanked piece keymap("v", "p", '"_dP', opts) -- removes highlighting after escaping vim search keymap("n", "", ":noh", opts) -- call vscode commands from neovim -- general keymaps keymap({"n", "v"}, "t", "lua require('vscode').action('workbench.action.terminal.toggleTerminal')") keymap({"n", "v"}, "b", "lua require('vscode').action('editor.debug.action.toggleBreakpoint')") keymap({"n", "v"}, "d", "lua require('vscode').action('editor.action.showHover')") keymap({"n", "v"}, "a", "lua require('vscode').action('editor.action.quickFix')") keymap({"n", "v"}, "sp", "lua require('vscode').action('workbench.actions.view.problems')") keymap({"n", "v"}, "cn", "lua require('vscode').action('notifications.clearAll')") keymap({"n", "v"}, "ff", "lua require('vscode').action('workbench.action.quickOpen')") keymap({"n", "v"}, "cp", "lua require('vscode').action('workbench.action.showCommands')") keymap({"n", "v"}, "pr", "lua require('vscode').action('code-runner.run')") keymap({"n", "v"}, "fd", "lua require('vscode').action('editor.action.formatDocument')") -- harpoon keymaps keymap({"n", "v"}, "ha", "lua require('vscode').action('vscode-harpoon.addEditor')") keymap({"n", "v"}, "ho", "lua require('vscode').action('vscode-harpoon.editorQuickPick')") keymap({"n", "v"}, "he", "lua require('vscode').action('vscode-harpoon.editEditors')") keymap({"n", "v"}, "h1", "lua require('vscode').action('vscode-harpoon.gotoEditor1')") keymap({"n", "v"}, "h2", "lua require('vscode').action('vscode-harpoon.gotoEditor2')") keymap({"n", "v"}, "h3", "lua require('vscode').action('vscode-harpoon.gotoEditor3')") keymap({"n", "v"}, "h4", "lua require('vscode').action('vscode-harpoon.gotoEditor4')") keymap({"n", "v"}, "h5", "lua require('vscode').action('vscode-harpoon.gotoEditor5')") keymap({"n", "v"}, "h6", "lua require('vscode').action('vscode-harpoon.gotoEditor6')") keymap({"n", "v"}, "h7", "lua require('vscode').action('vscode-harpoon.gotoEditor7')") keymap({"n", "v"}, "h8", "lua require('vscode').action('vscode-harpoon.gotoEditor8')") keymap({"n", "v"}, "h9", "lua require('vscode').action('vscode-harpoon.gotoEditor9')") -- project manager keymaps keymap({"n", "v"}, "pa", "lua require('vscode').action('projectManager.saveProject')") keymap({"n", "v"}, "po", "lua require('vscode').action('projectManager.listProjectsNewWindow')") keymap({"n", "v"}, "pe", "lua require('vscode').action('projectManager.editProjects')") vim.keymap.set('n', '', "Tabnext") vim.keymap.set('n', '', "Tabprev")