vim.keymap.set("n", ";", ":") vim.opt.expandtab = true vim.opt.tabstop = 4 vim.opt.smarttab = true vim.opt.shiftround = true vim.opt.shiftwidth = 4 vim.opt.smartcase = true vim.opt.ignorecase = true vim.opt.scrolloff = 6 -- eregex.vim vim.g.eregex_default_enable = 1 --KEYMAP vim.g.mapleader = " " local vsc = require("vscode") vim.keymap.set("n", "", function() vsc.action("workbench.action.toggleSidebarVisibility") end) vim.keymap.set("n", "`", function() vsc.action("workbench.action.terminal.toggleTerminal") end) vim.keymap.set("v", "se", function() vsc.action("editor.emmet.action.wrapWithAbbreviation") end) vim.keymap.set("n", "lg", function() vsc.action("lazygit.openLazygit") end) vim.keymap.set({ "n", "i", "v" }, "", 'echoe "Use Caps"') -- for some reason, this plugin does not work with keymaps that start with -- they are done through vsc -- -- vim.keymap.set("n", "v", function() -- vsc.action("workbench.action.showAllSymbols") -- end) -- vim.keymap.set("n", "f", function () -- vsc.action("workbench.action.quickOpen") -- end) -- vim.keymap.set("n", "t", function () -- vsc.action("workbench.action.quickTextSearch") -- end) vim.keymap.set("n", "e", function() -- print((":e " .. string.gsub(vim.fn.expand("%"), '(.*/)(.*)', '%1'))); vim.api.nvim_feedkeys((":e " .. string.gsub(vim.fn.expand("%"), "(.*/)(.*)", "%1")), "L", false) end) vim.keymap.set("n", "c", ':let @+=@"') vim.keymap.set("n", "z", function() vsc.action("workbench.action.toggleZenMode") end) vim.keymap.set("v", "h", ":S/", { noremap = true, }) vim.keymap.set("n", "h", ":%S/", { noremap = true, }) -- unmap vim.keymap.set({ "v", "n" }, "J", "") -- use for home and for end vim.keymap.set({ "n", "v", "o" }, "H", "g^") vim.keymap.set({ "n", "v", "o" }, "L", "g_") -- make #, closer to the cursor, fw search and * bw vim.keymap.set("n", "#", "*", { noremap = true, }) vim.keymap.set("n", "*", "#", { noremap = true, }) local function stupid(mode, lhs, rhs, args) vim.keymap.set(mode, lhs, function() vsc.action("vscode-neovim.send", { args = { rhs, }, }) end, args) end -- moving bewteen splits vim.cmd("nmap l") vim.cmd("nmap k") vim.cmd("nmap j") vim.cmd("nmap h") -- close vim.cmd("nmap c") -- quit vim.cmd("nmap q") -- resizing -- 3 lower width, 4 increace width vim.cmd("nmap <") vim.cmd("nmap >") -- e lower height, r increase height vim.cmd("nmap >") vim.cmd("nmap >") -- movement: -- o move left, p move right vim.cmd("nmap L") vim.cmd("nmap H") -- 9 move down, 0 move up vim.cmd("nmap K") vim.cmd("nmap J") -- ./init.lua vim.cmd("nmap v") vim.cmd("nmap s") vim.cmd("imap v") vim.cmd("imap s") -- go to file under cursor vim.cmd("nmap F") -- only -- makes more sense to use O for moving splits vim.cmd("nmap ") -- open Definition in split view vim.cmd("nmap }") -- move over folds vim.cmd("nmap j gj") vim.cmd("nmap k gk")