-- TODO: There are mappings that I did not port yet -- For instance: https://github.com/mjacobus/lvim/tree/main/after/ftplugin -- https://github.com/mjacobus/lvim/tree/main/after/plugin -- https://github.com/mjacobus/lvim/tree/main/autoload -- https://github.com/mjacobus/lvim/blob/main/after/plugin/legacy_setup.vim#L179-L212 -- Maybe some here: https://github.com/mjacobus/lvim/blob/main/lua/config/mappings.lua vim.g.mapleader = " " local map = vim.keymap.set local opts = { noremap = true, silent = true } map("n", "pv", vim.cmd.Ex) map("n", "w", ":w", { desc = "Save file" }) map("i", "jj", "") map("i", "jj", "", { desc = "Go to normal mode" }) map("n", "w", "write", { desc = "Save file" }) -- Placeholder: Replace with actual function if needed -- map("v", "", function() alternative_file.open("next", "--exists") end) -- Buffer management map("n", "Q", "q!", opts) map("n", "q", "bdelete", opts) map("n", "bdd", "bdelete!", opts) map("n", "bda", "bufdo %bd!", opts) -- Notes map("n", "et", ":e ~/.tmp/notes/", opts) map("n", "on", ":e ~/.tmp/notes/notes.md", opts) map("n", "con", ":e ~/.tmp/notes/notes.md", opts) -- Terminal escape map("t", "", "", opts) map("t", "jj", "", opts) -- Search map("n", "f", "/", opts) map("n", "F", "nohlsearch", opts) -- Quickfix map("n", "gn", ":cnext", opts) map("n", "gp", ":cprev", opts) -- Buffer navigation map("n", "bn", ":bn", opts) map("n", "bp", ":bp", opts) map("n", "b", ":b", opts) -- Select all map("n", "a", "ggVG", opts) -- Tabs map("n", "t", ":tabnew", opts) -- Insert helpers map("i", ",e", "/[\\]})\"']:nohlsearcha", opts) map("i", "", "=>", opts) -- Hashrocket map("v", "h", [[:s/\:\([a-zA-Z_]\+\)\s\+=>/\=printf("%s:", submatch(1))/g:let @/ = ""]], opts) -- Quit map("n", "qq", ":q", opts) -- Reload map("n", "rel", ":e", opts) -- File finder (stub) map("n", "*", ":find", opts) -- Formatting map("v", "Q", "gq", opts) map("n", "Q", "gqap", opts) -- Resizing map("n", "", "+", opts) map("n", "", "-", opts) map("n", "", "<", opts) map("n", "", ">", opts) -- Make file executable map("n", "xx", ":!chmod +x %", opts) -- Marks map("n", "mA", "ma", opts) map("n", "ma", "'a", opts) map("n", "m1", "'a", opts) map("n", "mB", "mb", opts) map("n", "mb", "'b", opts) map("n", "m2", "'b", opts) map("n", "mC", "mc", opts) map("n", "mc", "'c", opts) map("n", "m3", "'c", opts) map("n", "mD", "md", opts) map("n", "md", "'d", opts) map("n", "m4", "'d", opts) map("n", "mE", "me", opts) map("n", "me", "'e", opts) map("n", "m5", "'e", opts) -- Open notes map("n", "no", ":vs ~/.tmp/notes.md", opts) -- Open shell_test map("n", "1", ":e shell_test", opts) map("n", "at", function() require("mj.test_runner").run_all_tests() end, { desc = "Run all tests" }) map("n", "t", function() require("mj.test_runner").test_line() end, { desc = "Run test for current line" }) map("n", "t", function() require("mj.test_runner").test_line() end, { desc = "Run test for current line" }) map("n", "T", function() require("mj.test_runner").run_test_file() end, { desc = "Run test file" }) map("n", "st", function() require("mj.test_runner").run_shell_test() end, { desc = "Run ./shell_test" })