-- 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 -- -- -- KEYMAPS SPIDER vim.keymap.set({ "n", "o", "x" }, "w", "lua require('spider').motion('w')", { desc = "Spider-w" }) vim.keymap.set({ "n", "o", "x" }, "e", "lua require('spider').motion('e')", { desc = "Spider-e" }) vim.keymap.set({ "n", "o", "x" }, "b", "lua require('spider').motion('b')", { desc = "Spider-b" }) vim.keymap.set({ "n", "o", "x" }, "C-D", "", { desc = "page down" }) -- :SnipRun lua require’sniprun’.run() SnipRun -- (normal node) lua require’sniprun’.run(‘n’) SnipRunOperator -- :’<,’>SnipRun (visual mode) lua require’sniprun’.run(‘v’) SnipRun -- :SnipInfo lua require’sniprun’.info() SnipInfo -- :SnipReset lua require’sniprun’.reset() SnipReset -- :SnipReplMemoryClean lua require’sniprun’.clear_repl() SnipReplMemoryClean -- :SnipClose lua require’sniprun.display’.close_all() SnipClose -- :SnipLive lua require’sniprun.live_mode’.toggle() SnipLive -- vim.keymap.set({ "n", "x" }, "r", "SnipRun", { desc = "SnipRun" }) -- vim.keymap.set({ "v" }, "r", "'<,'>SnipRun", { desc = "SnipRun v" }) vim.api.nvim_set_keymap("v", "r", "SnipRun", { silent = true }) vim.api.nvim_set_keymap("n", "r", "SnipRun", { silent = true }) vim.api.nvim_set_keymap("n", "f", "SnipRunOperator", { silent = true }) -- AI -- vim.keymap.set({ "n", "o", "x" }, "ac", "GpChatToggle split", { desc = "toggle GP chat" }) -- vim.keymap.set({ "n", "o", "x" }, "aa", "GpAppend", { desc = "Add with Copilot" }) -- vim.keymap.set("n", "ap", ":GpPrepend", { noremap = true, silent = true, desc = "Prepend with copilot" }) -- vim.keymap.set({ "v" }, "ar", "'<,'>GpRewrite", { desc = "replace with Copilot" }) local bm = require("bookmarks") local map = vim.keymap.set map("n", "mm", bm.bookmark_toggle, { desc = "Toggle bookmark" }) map("n", "mi", bm.bookmark_ann, { desc = "Edit annotation" }) map("n", "mc", bm.bookmark_clean, { desc = "Clean marks" }) map("n", "mn", bm.bookmark_next, { desc = "Next mark" }) map("n", "mp", bm.bookmark_prev, { desc = "Prev mark" }) map("n", "ml", "Telescope bookmarks list", { desc = "List marks" }) map("n", "mx", bm.bookmark_clear_all, { desc = "Clear all bookmarks" }) map("n", "srf", function() local file_path = vim.api.nvim_buf_get_name(0) print(file_path) require("grug-far").open({ transient = true, prefills = { paths = file_path, }, }) end, { desc = "Search n replace in file" }) map("n", "ff", "FzfLua", { desc = "FZF commands" }) -- map("n", "mm", bm.bookmark_toggle) -- add or remove bookmark at current line -- map("n", "mi", bm.bookmark_ann) -- add or edit mark annotation at current line -- map("n", "mc", bm.bookmark_clean) -- clean all marks in local buffer -- map("n", "mn", bm.bookmark_next) -- jump to next mark in local buffer -- map("n", "mp", bm.bookmark_prev) -- jump to previous mark in local buffer -- map("n", "ml", "Telescope bookmarks list") -- show marked file list in quickfix window -- map("n", "mx", bm.bookmark_clear_all) -- removes all bookmarks -- -- floating terminal -- map("n", "fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" }) -- map("n", "ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) -- map("n", "", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) -- map("n", "", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" }) -- -- -- Terminal Mappings -- map("t", "", "close", { desc = "Hide Terminal" }) -- map("t", "", "close", { desc = "which_key_ignore" }) map("n", "qw", "wq", { desc = "save & quit" }) local td_cli = require("toggleterm.terminal").Terminal:new({ cmd = "node /home/omnissiah/git/td/dist/cli.js", direction = "float", close_on_exit = false, hidden = true, on_open = function(term) vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) vim.api.nvim_buf_set_keymap(term.bufnr, "t", "", ":close", { noremap = true, silent = true }) vim.api.nvim_buf_set_keymap(term.bufnr, "t", "", "close", { noremap = true, silent = true }) end, }) vim.keymap.set("t", "\\", function() td_cli:toggle() end, { desc = "Toggle TD CLI floating terminal" }) vim.keymap.set("n", "\\", function() td_cli:toggle() end, { desc = "Toggle TD CLI floating terminal" }) -- vim.keymap.set("t", "", "ToggleTerm", { noremap = true, silent = true })