2023-05-13 00:45:08 +00:00
|
|
|
-- 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
|
2023-08-29 10:23:09 +00:00
|
|
|
|
|
|
|
local function map(mode, lhs, rhs, opts)
|
|
|
|
local keys = require("lazy.core.handler").handlers.keys
|
|
|
|
---@cast keys LazyKeysHandler
|
|
|
|
-- do not create the keymap if a lazy keys handler exists
|
|
|
|
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
|
|
|
opts = opts or {}
|
|
|
|
opts.silent = opts.silent ~= false
|
|
|
|
if opts.remap and not vim.g.vscode then
|
|
|
|
opts.remap = nil
|
|
|
|
end
|
|
|
|
vim.keymap.set(mode, lhs, rhs, opts)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-10-02 03:27:12 +00:00
|
|
|
map(
|
|
|
|
"n",
|
|
|
|
"<C-u>",
|
|
|
|
"<Cmd>lua vim.cmd('normal! <C-u>'); MiniAnimate.execute_after('scroll', 'normal! zz')<CR>",
|
|
|
|
{ desc = "Centered Half Page Up", remap = true }
|
|
|
|
)
|
|
|
|
map(
|
|
|
|
"n",
|
|
|
|
"<C-d>",
|
|
|
|
"<Cmd>lua vim.cmd('normal! <C-d>'); MiniAnimate.execute_after('scroll', 'normal! zz')<CR>",
|
|
|
|
{ desc = "Centered Half Page Down", remap = true }
|
|
|
|
)
|
2024-01-31 22:25:28 +00:00
|
|
|
map("n", "<leader>u<Tab>", ":set list!<CR>", { desc = "Toggle list (Whitespace display)", remap = true })
|