dotfiles/dot_config/nvim/lua/config/keymaps.lua

22 lines
857 B
Lua

-- 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 = vim.keymap.set
-- replace ex mode map and use it for repeating 'q' macro
map("n", "Q", "@q")
map("v", "Q", "<cmd>norm @q<CR>")
-- Easier in-file navigation with Tab and S-Tab
map("n", "<S-Tab>", "<C-U>")
map("n", "<Tab>", "<C-D>")
map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-- Testing
map("n", "<leader>tr", "require('neotest').run.run()<CR>")
map("n", "<leader>td", "require('dap-go').debug_test()<CR>")
map("n", "<leader>to", "require('neotest').output.open({enter = true})<CR>")
map("n", "<leader>tS", "require('neotest').run.stop()<CR>")
map("n", "<leader>ts", "require('neotest').summary.toggle()<CR>")