-- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here local map = LazyVim.safe_keymap_set -- better up/down map("i", "jj", "", { desc = "Go to normal mode" }) map("n", "w", "write", { desc = "Save file" }) local alternative_file = require("mj.alternate_file") map("n", "ak", function() alternative_file.open("next", "--exists") end, { desc = "Open next alternative file" }) map("n", "aj", function() alternative_file.open("prev", "--exists") end, { desc = "Open previous alternative file" }) -- Import the map function from LazyVim local map = LazyVim.safe_keymap_set -- Key mappings map("n", "Q", "q!", { desc = "Quit" }) map("n", "q", "bdelete", { desc = "Close buffer" }) map("n", "bdd", "bdelete!", { desc = "Close buffer!" }) map("n", "bda", "bufdo %bd!", { desc = "Close all buffers!" }) -- Notes map("n", "et", ":e ~/.tmp/notes/", { desc = "Edit notes" }) map("n", "on", ":e ~/.tmp/notes/notes.md", { desc = "Open notes" }) map("n", "con", ":e ~/.tmp/notes/notes.md", { desc = "Open notes" }) map("n", "j", function() require("mj.utils").close_terminal_buffer(true) end, { desc = "Close terminal buffer (true)" }) map("n", "k", function() require("mj.utils").close_terminal_buffer(false) end, { desc = "Close terminal buffer (false)" }) -- Search mappings map("n", "f", "/", { desc = "Search alias" }) map("n", "F", "nohlsearch", { desc = "Remove search highlight" }) -- Alternative file map("n", "af", "", { desc = "Alternative file" }) -- Avoid arrow keys in command mode map("c", "", "", { desc = "Move left" }) map("c", "", "", { desc = "Move down" }) map("c", "", "", { desc = "Move up" }) map("c", "", "", { desc = "Move right" }) map("c", "", "", { desc = "Delete" }) -- Alternative file navigation map("n", "ak", function() alternative_file.open("next", "--exists") end, { desc = "Next alternative file" }) map("n", "aj", function() alternative_file.open("prev", "--exists") end, { desc = "Previous alternative file" }) -- Diagnostic config vim.diagnostic.config({ virtual_text = false }) -- Running tests 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").run_test_file() end, { desc = "Run test file" }) map("n", "st", function() require("mj.test_runner").run_shell_test() end, { desc = "Run ./shell_test" })