local map = require("helpers.keys").map -- Quick access to some common actions map("n", "fw", "w", "Write") map("n", "fa", "wa", "Write all") map("n", "qq", "q", "Quit") map("n", "qa", "qa!", "Quit all") map("n", "dw", "close", "Window") map("n", ";", "A;", "places \";\" at end of line") -- Diagnostic keymaps map('n', 'gx', vim.diagnostic.open_float, "Show diagnostics under cursor") -- Easier access to beginning and end of lines map("n", "", "^", "Go to beginning of line") map("n", "", "$", "Go to end of line") -- Better window navigation map("n", "", "", "Navigate windows to the left") map("n", "", "", "Navigate windows down") map("n", "", "", "Navigate windows up") map("n", "", "", "Navigate windows to the right") -- Move with shift-arrows map("n", "", "", "Move window to the left") map("n", "", "", "Move window down") map("n", "", "", "Move window up") map("n", "", "", "Move window to the right") -- Resize with arrows map("n", "", ":resize +2") map("n", "", ":resize -2") map("n", "", ":vertical resize +2") map("n", "", ":vertical resize -2") -- Deleting buffers local buffers = require("helpers.buffers") map("n", "db", buffers.delete_this, "Current buffer") map("n", "do", buffers.delete_others, "Other buffers") map("n", "da", buffers.delete_all, "All buffers") -- Navigate buffers map("n", "", ":bnext") map("n", "", ":bprevious") -- Stay in indent mode map("v", "<", "", ">gv") -- Switch between light and dark modes map("n", "ut", function() if vim.o.background == "dark" then vim.o.background = "light" else vim.o.background = "dark" end end, "Toggle between light and dark themes") -- Clear after search map("n", "ur", "nohl", "Clear highlights") -- Open config map("n", "Nc", "tabnew ~/.config/nvim/init.lua", "Open Config") -- Open Common Files map("n", "fm", "tabnew ~/vex/roberts", "Open Roberts") map("n", "fp", "tabnew ~/vex/patch", "Open Patch") -- New Tab Terminal (for more perminent use) map("n", "ft", "tabf term://fish", "Open New Terminal") map("t", "", "", "Return to normal mode") map("t", "", "gt", "Go to next tab") map("t", "", "q", "Close current terminal") -- Lazygit config local Terminal = require('toggleterm.terminal').Terminal local lazygit = Terminal:new({cmd = "lazygit", hidden = true, direction='tab'}) function _lazygit_toggle() lazygit:toggle() end map("n", "gg", "lua _lazygit_toggle()", "open lazygit") -- Bacon config local bacon = Terminal:new({cmd = "bacon --job clippy", hidden = true, direction='tab'}) function _bacon_toggle() bacon:toggle() end map("n", "h", "lua _bacon_toggle()", "open bacon") -- Wiki-tui config local wiki = Terminal:new({cmd = "wiki-tui", hidden = true, direction='tab'}) function _wiki_toggle() wiki:toggle() end map("n", "sl", "lua _wiki_toggle()", "open wiki-tui")