local map = vim.keymap.set -- general mappings map('n', ';', ':') map("n", "rn", "set rnu!", { desc = "Toggle Relative number" }) map("n", "", "w", { desc = "File Save" }) map("n", "", "h", { desc = "Switch Window left" }) map("n", "", "l", { desc = "Switch Window right" }) map("n", "", "j", { desc = "Switch Window down" }) map("n", "", "k", { desc = "Switch Window up" }) map("n", "qq", ":wa:qa" ) -- telescope keybinds local builtin = require('telescope.builtin') map('n', 'ff', builtin.find_files, { desc = '[f]ind [f]ile' }) map('n', 'pg', builtin.live_grep, { desc = '[p]roject [g]rep' }) map('n', 'fb', builtin.buffers, { desc = '[f]ind [b]uffer' }) map('n', 'fh', builtin.help_tags, { desc = '[f]ind [h]elp' }) map("n", "fg", "Telescope current_buffer_fuzzy_find", { desc = "[f]ile [g]rep" }) -- base46 maps map('n', 'th', 'Telescope themes', { desc = '[th]emes' }) -- nvim-tree mapping map('n', 'e', 'NvimTreeOpen') -- comment map("n", "/", function() require("Comment.api").toggle.linewise.current() end, { desc = "Comment Toggle" }) -- tabufline map("n", "", function() require("nvchad.tabufline").next() end, { desc = "Buffer Goto next" }) map("n", "", function() require("nvchad.tabufline").prev() end, { desc = "Buffer Goto prev" }) map("n", "x", function() require("nvchad.tabufline").close_buffer() end, { desc = "Buffer Close" }) -- lsp map("n", "lf", vim.diagnostic.open_float, { desc = "Lsp floating diagnostics" }) map("n", "[d", vim.diagnostic.goto_prev, { desc = "Lsp prev diagnostic" }) map("n", "]d", vim.diagnostic.goto_next, { desc = "Lsp next diagnostic" }) map("n", "q", vim.diagnostic.setloclist, { desc = "Lsp diagnostic loclist" }) map( "v", "/", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = "Comment Toggle" } )