diff --git a/lua/config/keybinds.lua b/lua/config/keybinds.lua index 3323b57..f521f3e 100644 --- a/lua/config/keybinds.lua +++ b/lua/config/keybinds.lua @@ -2,13 +2,6 @@ -- -------------------------------- KEYBINDS ----------------------------------- -- ----------------------------------------------------------------------------- --- --------------------------------- Keymaps ----------------------------------- -vim.keymap.set( -- Explorer - "n", - "E", - "lua require('neo-tree.command').execute({ toggle = true, dir = vim.uv.cwd() })" -) - -- -------------------------------- Commands ----------------------------------- -- Make :Q close all of the buffers vim.api.nvim_create_user_command("Q", function() @@ -16,10 +9,52 @@ vim.api.nvim_create_user_command("Q", function() vim.cmd.qall() end, { force = true }) --- ------------------------------- Leader Maps --------------------------------- +-- --------------------------------- Keymaps ----------------------------------- local wk = require("which-key") -local opts = { noremap = true, silent = true } wk.add({ + { + "E", + "lua require('neo-tree.command').execute({ toggle = true, dir = vim.uv.cwd() })", + desc = "Explorer (CWD)", + }, + { + "", + ":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", @@ -60,9 +95,95 @@ wk.add({ icon = { icon = "", color = "yellow" }, }, { - "I", - group = "IconPicker", - icon = { icon = "󰥸", color = "orange" }, + "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, }, }) diff --git a/lua/plugins/codesnap.lua b/lua/plugins/codesnap.lua index 1bad3de..67bfbea 100644 --- a/lua/plugins/codesnap.lua +++ b/lua/plugins/codesnap.lua @@ -4,37 +4,10 @@ return { "mistricky/codesnap.nvim", build = "make", - keys = { - { - "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", - }, - }, opts = { save_path = "~/Pictures/Screenshots/", has_breadcrumbs = true, show_workspace = true, - --has_line_number = true, bg_theme = "default", watermark = "Rootiest Snippets", code_font_family = "Iosevka NF", diff --git a/lua/plugins/gx.lua b/lua/plugins/gx.lua index 0ae088f..ba1bbee 100644 --- a/lua/plugins/gx.lua +++ b/lua/plugins/gx.lua @@ -3,13 +3,6 @@ -- ----------------------------------------------------------------------------- return { "chrishrb/gx.nvim", - keys = { - { - "gx", - "Browse", - mode = { "n", "x" }, - }, - }, cmd = { "Browse" }, init = function() vim.g.netrw_nogx = 1 diff --git a/lua/plugins/icon-picker.lua b/lua/plugins/icon-picker.lua index 804331f..96f59a2 100644 --- a/lua/plugins/icon-picker.lua +++ b/lua/plugins/icon-picker.lua @@ -5,9 +5,5 @@ return { "ziontee113/icon-picker.nvim", config = function() require("icon-picker").setup({ disable_legacy_commands = true }) - local opts = { noremap = true, silent = true } - vim.keymap.set("n", "Ii", "Pick Icon", opts) - vim.keymap.set("n", "Iy", "Yank Icon", opts) - vim.keymap.set("i", "", "IconPickerInsert", opts) end, } diff --git a/lua/plugins/kitty-navigator.lua b/lua/plugins/kitty-navigator.lua index 7ec8436..01e2054 100644 --- a/lua/plugins/kitty-navigator.lua +++ b/lua/plugins/kitty-navigator.lua @@ -1,16 +1,27 @@ -- ----------------------------------------------------------------------------- -- ----------------------------- kitty-navigator ------------------------------- -- ----------------------------------------------------------------------------- +-- return { +-- "knubie/vim-kitty-navigator", +-- build = { +-- "cp ./*.py ~/.config/kitty/", +-- }, +-- cond = function() -- Using Kitty +-- local term = os.getenv("TERM") or "" +-- local kit = string.find(term, "kitty") +-- return kit ~= nil +-- end, +-- } + return { - "knubie/vim-kitty-navigator", - cond = function() -- Using Kitty - local term = os.getenv("TERM") - return term and string.find(term, "kitty") - end, - keys = { - { "", "KittyNavigateLeft", desc = "KittyNavigateLeft" }, - { "", "KittyNavigateDown", desc = "KittyNavigateDown" }, - { "", "KittyNavigateUp", desc = "KittyNavigateUp" }, - { "", "KittyNavigateRight", desc = "KittyNavigateRight" }, + "MunsMan/kitty-navigator.nvim", + build = { + "cp navigate_kitty.py ~/.config/kitty", + "cp pass_keys.py ~/.config/kitty", }, + cond = function() -- Using Kitty + local term = os.getenv("TERM") or "" + local kit = string.find(term, "kitty") + return kit ~= nil + end, } diff --git a/lua/plugins/kitty-runner.lua b/lua/plugins/kitty-runner.lua index 216ea3e..131e3c3 100644 --- a/lua/plugins/kitty-runner.lua +++ b/lua/plugins/kitty-runner.lua @@ -4,8 +4,8 @@ return { "jghauser/kitty-runner.nvim", cond = function() -- Using Kitty - local term = os.getenv("TERM") - return term and string.find(term, "kitty") + local term = os.getenv("TERM") or "" + local kit = string.find(term, "kitty") + return kit ~= nil end, } - diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua index 7df8595..aa155ec 100644 --- a/lua/plugins/lazygit.lua +++ b/lua/plugins/lazygit.lua @@ -13,7 +13,4 @@ return { dependencies = { "nvim-lua/plenary.nvim", }, - keys = { - { "lg", "LazyGit", desc = "LazyGit" }, - }, } diff --git a/lua/plugins/rip-substitute.lua b/lua/plugins/rip-substitute.lua index 3bc86c9..acff236 100644 --- a/lua/plugins/rip-substitute.lua +++ b/lua/plugins/rip-substitute.lua @@ -1,17 +1,8 @@ -- ----------------------------------------------------------------------------- -- ----------------------------- rip-substitute -------------------------------- -- ----------------------------------------------------------------------------- + return { "chrisgrieser/nvim-rip-substitute", cmd = "RipSubstitute", - keys = { - { - "fs", - function() - require("rip-substitute").sub() - end, - mode = { "n", "x" }, - desc = "Rip Substitute", - }, - }, } diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 5ae4dbd..8c08d25 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -40,12 +40,5 @@ return { end, }, }) - -- Keybinds - vim.api.nvim_set_keymap( - "n", - "", - ":ToggleTerm", - { noremap = true, desc = " Open Terminal" } - ) end, -} \ No newline at end of file +}