-- 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 local Util = require("lazyvim.util") 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 map("n", "xs", ":FloatermNew --disposable --name=duaroot --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", { desc = "Workspace Size (root dir)" }) map("n", "xS", ":FloatermNew --disposable --name=duabuffer --titleposition=center --height=0.85 --width=0.85 --cwd= dua i", { desc = "Workspace Size (cwd)" }) map("n", "fx", ":FloatermNew --disposable --name=xplrroot --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", { desc = "Xplr (root dir)" }) map("n", "fX", ":FloatermNew --disposable --name=xplrbuffer --titleposition=center --height=0.85 --width=0.85 --cwd= xplr", { desc = "Xplr (cwd)" }) map("n", "gg", ":FloatermNew --disposable --name=lazygitroot --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", { desc = "Lazygit (root dir)" }) map("n", "gG", ":FloatermNew --disposable --name=lazygitbuffer --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", { desc = "Lazygit (cwd)" }) map("n", "t", ":Telescope floaterm", { desc = "Terminals" }) map("n", "ft", ":FloatermNew --name=termroot --titleposition=center --height=0.85 --width=0.85 --cwd=", { desc = "New Terminal (root dir)" }) map("n", "fT", ":FloatermNew --name=termcwd --titleposition=center --height=0.85 --width=0.85 --cwd=", { desc = "New Terminal (cwd)" }) map("n", "", "FloatermPrev", { desc = "Previous Terminal" }) map("n", "", "FloatermNext", { desc = "Next Terminal" }) map("n", "", ":FloatermToggle", { desc = "Toggle Terminal" }) map("n", "", ":FloatermToggle", { desc = "which_key_ignore" }) vim.keymap.set("n", "uu", vim.cmd.UndotreeToggle, { noremap = true, silent = true, desc = "Toggle Undotree" })