-- -----------------------------------------------------------------------------
-- -------------------------------- KEYBINDS -----------------------------------
-- -----------------------------------------------------------------------------
-- --------------------------------- Keymaps -----------------------------------
local wk = require("which-key")
wk.add({
{
"",
":ToggleTerm",
desc = "Toggle Terminal",
},
{
"gt",
rhs = function()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
end,
desc = "LazyGit Terminal",
},
{
"I",
group = "IconPicker",
icon = { icon = "", color = "orange" },
},
{
"Ii",
"IconPickerNormal",
desc = "Pick Icon",
group = "IconPicker",
},
{
"Iy",
"IconPickerYank",
desc = "Yank Icon",
group = "IconPicker",
},
{
mode = "i",
"",
"IconPickerInsert",
desc = "Insert Icon",
group = "IconPicker",
},
{
"gS",
"LazyGit",
desc = "LazyGit",
},
{
"gn",
group = "Gists",
icon = { icon = "", color = "orange" },
},
{
"gnc",
"GistCreate",
desc = "Create Gist",
},
{
"gnf",
"GistList",
desc = "Find Gists",
},
{
"l",
group = "Lazy",
},
{
"lv",
"Lazy",
desc = "LazyVim",
},
{
"lx",
"LazyExtras",
desc = "LazyExtras",
},
{
"m",
group = "MiniMap",
icon = { icon = "", color = "yellow" },
},
{
"cy",
"CodeSnap",
mode = "x",
desc = "Save selected code snapshot into clipboard",
},
{
"cs",
"CodeSnapSave",
mode = "x",
desc = "Save selected code snapshot in ~/Pictures",
},
{
"ch",
"CodeSnapHighlight",
mode = "x",
desc = "Highlight and snapshot selected code into clipboard",
},
{
"ci",
"CodeSnapASCII",
mode = "x",
desc = "Save ASCII code snapshot into clipboard",
},
{
"gx",
"Browse",
mode = { "n", "x" },
desc = "Open URL/Link",
},
{
"lg",
"LazyGit",
desc = "LazyGit",
},
{
"fs",
rhs = function()
require("rip-substitute").sub()
end,
mode = { "n", "x" },
desc = "Rip Substitute",
},
{
"",
rhs = function()
require("kitty-navigator").navigateLeft()
end,
desc = "KittyNavigateLeft",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end,
},
{
"",
rhs = function()
require("kitty-navigator").navigateDown()
end,
desc = "KittyNavigateDown",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end,
},
{
"",
rhs = function()
require("kitty-navigator").navigateUp()
end,
desc = "KittyNavigateUp",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end,
},
{
"",
rhs = function()
require("kitty-navigator").navigateRight()
end,
desc = "KittyNavigateRight",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end,
},
{
"zk",
rhs = function()
require("precognition").toggle()
end,
desc = "Toggle Precognition",
},
{
"a",
"Alternate",
desc = "Toggle Alternate",
cond = function()
return (
vim.bo.filetype == "c"
or vim.bo.filetype == "h"
or vim.bo.filetype == "cpp"
or vim.bo.filetype == "hpp"
)
end,
},
{
"wt",
"TransparentToggle",
desc = "Toggle Transparency",
},
{
mode = "x",
lhs = "r",
rhs = function()
require("substitute").visual()
end,
desc = "Substitute",
},
})
-- ---------------------------- Spell Correction -------------------------------
require("config.spellcheck")