-- maps.lua local maps = {} function maps.term() vim.api.nvim_set_keymap('n', 't', 'sj :terminal:res 5i', { noremap = false, desc = "Open and move to terminal" }) vim.api.nvim_set_keymap('t', 'ß', '', { noremap = true, desc = "Enter normal mode in terminal" }) end function maps.fixIndent() vim.api.nvim_set_keymap('v', '<', '', '>gv', { noremap = true, desc = "Add identation level" }) end function maps.moveByRow() -- When text is wrapped, move by terminal rows, not lines, unles a count is provided vim.api.nvim_set_keymap('n', 'j', 'v:count == 0 ? \'gj\' : \'j\'', { silent = true, expr = true, desc = "Go down 1 line" }) vim.api.nvim_set_keymap('n', 'k', 'v:count == 0 ? \'gk\' : \'k\'', { silent = true, expr = true, desc = "Go up 1 line" }) end function maps.centeredSearch() vim.api.nvim_set_keymap('n', 'n', 'nzzzv', { noremap = true, desc = "Search next" }) vim.api.nvim_set_keymap('n', 'N', 'Nzzzv', { noremap = true, desc = "Search previous" }) end function maps.init() vim.g.mapleader = " " vim.api.nvim_set_keymap('n', 'b', 'Lexplore | vert res 30', { noremap = true, desc = "Open file explorer" }) maps.term() maps.fixIndent() maps.moveByRow() maps.centeredSearch() end return { "folke/which-key.nvim", event = "VeryLazy", keys = { { "?", function() require("which-key").show({ global = false }) end, desc = "Buffer Local Keymaps (which-key)", }, }, config = function() require("which-key").setup({ preset = "helix" }) local wk = require("which-key") maps.init() end }