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", "n ~/.config/nvim/init.lua", "Open Config") -- ToggleTerm 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")