---@module "data.keys" --- This module contains the keymaps for the plugins and commands. --- Keymaps use the add_keymap function from data.func for flexible --- keybinding functionality. -- ╭─────────────────────────────────────────────────────────╮ -- │ KEYS DATA │ -- ╰─────────────────────────────────────────────────────────╯ local M = {} -- Load utils local rootiest = require("config.rootiest") M.alternate = { { -- Toggle Alternate "a", "Alternate", desc = "Toggle Alternate", }, } M.capsword = { { "", function() require("caps-word").toggle() end, desc = "Toggle CapsWord", mode = { "i", "n" }, }, } M.codesnap = { { -- Save selected code snapshot into clipboard "cy", "CodeSnap", desc = "Save selected code snapshot into clipboard", mode = "x", }, { -- Save selected code snapshot in ~/Pictures "cs", "CodeSnapSave", desc = "Save selected code snapshot in ~/Pictures", mode = "x", }, { -- Highlight and snapshot selected code into clipboard "ch", "CodeSnapHighlight", desc = "Highlight and snapshot selected code into clipboard", mode = "x", }, { -- Save ASCII code snapshot into clipboard "ci", "CodeSnapASCII", desc = "Save ASCII code snapshot into clipboard", mode = "x", }, } M.flash = { { -- Flash jump to next "", function() require("flash").jump() end, desc = "Flash jump", mode = { "n", "o", "v" }, }, } M.minimap = { { -- Toggle minimap "nt", "Neominimap toggle", desc = "Toggle minimap", }, { -- Enable minimap "no", "Neominimap on", desc = "Enable minimap", }, { -- Disable minimap "nc", "Neominimap off", desc = "Disable minimap", }, { -- Refresh minimap "nf", "Neominimap focus", desc = "Focus on minimap", }, { -- Unfocus minimap "nu", "Neominimap unfocus", desc = "Unfocus minimap", }, { -- Toggle focus "ns", "Neominimap toggleFocus", desc = "Toggle focus on minimap", }, { -- Toggle minimap for current window "nwt", "Neominimap winToggle", desc = "Toggle minimap for current window", }, { -- Refresh minimap for current window "nwr", "Neominimap winRefresh", desc = "Refresh minimap for current window", }, { -- Enable minimap for current window "nwo", "Neominimap winOn", desc = "Enable minimap for current window", }, { -- Disable minimap for current window "nwc", "Neominimap winOff", desc = "Disable minimap for current window", }, { -- Toggle minimap for current buffer "nbt", "Neominimap bufToggle", desc = "Toggle minimap for current buffer", }, { -- Refresh minimap for current buffer "nbr", "Neominimap bufRefresh", desc = "Refresh minimap for current buffer", }, { -- Enable minimap for current buffer "nbo", "Neominimap bufOn", desc = "Enable minimap for current buffer", }, { -- Disable minimap for current buffer "nbc", "Neominimap bufOff", desc = "Disable minimap for current buffer", }, } M.neocodeium = { { -- Accept suggestion "", function() require("neocodeium").accept() end, desc = "Accept suggestion", mode = "i", }, { -- Accept word "", function() require("neocodeium").accept_word() end, desc = "Accept word", mode = "i", }, { -- Accept line "", function() require("neocodeium").accept_line() end, desc = "Accept line", mode = "i", }, { -- Cycle or complete (previous) "", function() require("neocodeium").cycle_or_complete(-1) end, desc = "Cycle or complete (previous)", mode = "i", }, { -- Cycle or complete (next) "", function() require("neocodeium").cycle_or_complete() end, desc = "Cycle or complete (next)", mode = "i", }, } M.foldnav = { { -- Goto Start "", function() require("foldnav").goto_start() end, }, { -- Goto Next "", function() require("foldnav").goto_next() end, }, { -- Goto Prev "", function() require("foldnav").goto_prev_start() end, }, { -- Goto End "", function() require("foldnav").goto_end() end, }, } M.gitlinker = { { -- Yank git link "gy", "GitLink", mode = { "n", "v" }, desc = "Yank git link", }, { -- Open git link "gY", "GitLink!", mode = { "n", "v" }, desc = "Open git link", }, } M.gitgraph = { { -- gitgraph_toggle "gm", function() require("utils.git").gitgraph_toggle() end, desc = "GitGraph - Toggle", }, } M.gist = { { -- Create Gist "gnc", "GistCreate", desc = "Create Gist", mode = { "n", "x" }, }, { -- Find Gists "gnf", "GistList", desc = "Find Gists", }, } M.groups = { { -- Icon picker menu lhs = "I", group = "IconPicker", icon = { icon = "󰥸", color = "orange" }, }, { -- Gists menu lhs = "gn", group = "Gists", icon = { icon = "", color = "orange" }, }, { -- Lazy menu lhs = "l", group = "Lazy", icon = { icon = "󰒲", color = "red" }, }, { -- MiniMap menu lhs = "n", group = "MiniMap", icon = { icon = "", color = "green" }, }, { -- Code action menu lhs = "C", group = "CodeActions", icon = { icon = "", color = "yellow" }, }, } M.gx = { { -- Open URL/Link "gx", "Browse", mode = { "n", "x" }, desc = "Open URL/Link", }, } M.iconpicker = { { -- Pick Icon "Ii", "IconPickerNormal", desc = "Pick Icon", }, { -- Yank Icon "Iy", "IconPickerYank", desc = "Yank Icon", }, { -- Insert Icon in insert mode "", "IconPickerInsert", desc = "Insert Icon", mode = "i", }, } M.indentor = { { -- Indentor "", function() require("utils.indentor").insert_previous_line_indentation() end, "Insert Previous Line Indentation", { "i", "n" }, }, } M.lazygit = { { -- LazyGit "lg", "LazyGit", desc = "LazyGit", }, } M.minifiles = { { "fm", function() require("mini.files").open(vim.api.nvim_buf_get_name(0), true) end, desc = "Open mini.files (Directory of Current File)", }, { "fM", function() require("mini.files").open(vim.uv.cwd(), true) end, desc = "Open mini.files (cwd)", }, } M.misc = { { -- Yank line (without whitespace) lhs = "yo", rhs = function() rootiest.yank_line() end, desc = "Yank Line-text", }, { -- Hardmode lhs = "uH", rhs = function() rootiest.toggle_hardmode() end, desc = "Toggle Hardmode", }, { -- Reload config lhs = "qr", rhs = function() require("data.func").reload_config() end, desc = "Reload Config", }, { -- Yank buffer lhs = "Y", rhs = "%y", desc = "Yank buffer contents", }, { -- Select all lhs = "", rhs = "norm ggVG", desc = "Select all", }, { -- Neotree lhs = "|", rhs = "Neotree reveal toggle", desc = "Neotree toggle", }, { -- Neotree lhs = "\\", rhs = "Neotree reveal toggle", desc = "Neotree toggle", }, { -- Mini.files lhs = ".", rhs = "lua require('mini.files').open()", desc = "Open mini.files", }, { -- Telescope Frecency lhs = "", rhs = "Telescope frecency workspace=CWD", desc = "Telescope frecency", }, { -- Exit Neovim lhs = "Q", rhs = "lua require('data').func.exit()", desc = "Exit Neovim", }, { -- LazyVim lhs = "lv", rhs = "Lazy", desc = "LazyVim", }, { -- LazyExtras lhs = "lx", rhs = "LazyExtras", desc = "LazyExtras", }, { -- De-map Ctrl+Shift+LeftClick to avoid conflicts with WezTerm lhs = "", rhs = "", desc = "Prevent conflict with WezTerm hyperlinks", mode = "n", hidden = true, }, } M.nekifoch = { { -- List Fonts "u,l", "Nekifoch list", desc = "Fonts list", }, { -- Check Font "u,c", "Nekifoch check", desc = "Check current font settings", }, { -- Set Font Family "u,f", function() require("nekifoch.nui_set_font")() end, desc = "Set font family", }, { -- Set Font Size "u,s", function() require("nekifoch.nui_set_size")() end, desc = "Set font size", }, } M.precog = { { -- Toggle Precognition "zk", function() require("config.rootiest").toggle_precognition() end, desc = "Toggle Precognition", }, } M.qalc = { { -- Open Qalc "qc", "Qalc", desc = "Qalc", }, } M.ripsub = { { -- Rip Substitute "fs", function() require("rip-substitute").sub() end, mode = { "n", "x" }, desc = "Rip Substitute", }, } M.splitjoin = { toggle = "gJ", } M.splits = { resize = { { -- Resize split leftwards "", function() require("smart-splits").resize_left() end, "Resize split left", }, { -- Resize split downwards "", function() require("smart-splits").resize_down() end, "Resize split down", }, { -- Resize split upwards "", function() require("smart-splits").resize_up() end, "Resize split up", }, { -- Resize split rightwards "", function() require("smart-splits").resize_right() end, "Resize split right", }, { -- Start interactive split resizing "", function() require("smart-splits").start_resize_mode() end, "Resize split interactively", }, }, move = { { -- Move cursor to split left "", function() require("smart-splits").move_cursor_left() end, "Move to split left", }, { -- Move cursor to split below "", function() require("smart-splits").move_cursor_down() end, "Move to split below", }, { -- Move cursor to split above "", function() require("smart-splits").move_cursor_up() end, "Move to split above", }, { -- Move cursor to split right "", function() require("smart-splits").move_cursor_right() end, "Move to split right", }, { -- Move cursor to previous split "", function() require("smart-splits").move_cursor_previous() end, "Move to previous split", }, }, swap = { { -- Swap buffer with the one to the left "", function() require("smart-splits").swap_buf_left() end, "Swap buffer left", }, { -- Swap buffer with the one below "", function() require("smart-splits").swap_buf_down() end, "Swap buffer down", }, { -- Swap buffer with the one above "", function() require("smart-splits").swap_buf_up() end, "Swap buffer up", }, { -- Swap buffer with the one to the right "", function() require("smart-splits").swap_buf_right() end, "Swap buffer right", }, }, } M.substitute = { { -- Substitute operator in normal mode "x", function() require("substitute").operator() end, desc = "Substitute operator", }, { -- Substitute line in normal mode "xx", function() require("substitute").line() end, desc = "Substitute line", }, { -- Substitute end of line in normal mode "X", function() require("substitute").eol() end, desc = "Substitute end of line", }, { -- Substitute visual selection in visual mode "x", function() require("substitute").visual() end, desc = "Substitute visual selection", mode = "x", }, { -- Substitute visual selection in visual mode "r", function() require("substitute").visual() end, desc = "Substitute", mode = "x", }, } M.overrides = { { -- De-map 's' to avoid conflicts with mini.surround lhs = "s", rhs = "", desc = "Surround", mode = { "n", "x" }, }, } M.toggleterm = { { -- Toggle Terminal "", "ToggleTerm", desc = "Toggle Terminal", mode = "n", }, } M.transparent = { { "wt", function() require("transparent").toggle() end, desc = "Toggle Transparency", }, } M.zen = { { -- Toggle ZenMode "z", function() require("zen-mode").toggle() end, desc = "Toggle ZenMode", }, } return M