diff options
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua | 2 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/keys.lua | 1 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/macro.lua | 204 |
3 files changed, 169 insertions, 38 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua index d2bc5bb..56e0727 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua @@ -26,7 +26,7 @@ vim.keymap.set({ "n", "v" }, "<leader>wq", "<cmd>wq<cr>", { desc = "Save current vim.keymap.set({ "n", "v" }, "<leader>WQ", "<cmd>wqa<cr>", { desc = "Save all buffers and quit" }) vim.keymap.set({ "n", "v" }, "<leader>qq", "<cmd>q!<cr>", { desc = "Force quit" }) vim.keymap.set({ "n", "v" }, "<leader>QQ", "<cmd>qa!<cr>", { desc = "Force quit all" }) -vim.keymap.set("n", "<leader>rn", function() +vim.keymap.set("n", "<leader>rnf", function() local current_name = vim.fn.expand("%:p") -- Get the full path of the current file local directory = vim.fn.expand("%:p:h") -- Get the directory of the current file local new_name = vim.fn.input("New filename: ", directory .. "/") -- Prompt for the new name diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/keys.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/keys.lua index 8efb41f..be0c957 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/keys.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/keys.lua @@ -64,6 +64,7 @@ return { { "<leader>p", group = "Paste" }, { "<leader>P", group = "Paste" }, { "<leader>q", group = "Quit" }, + { "<leader>rn", group = "Rename" }, { "<leader>sk", group = "Keys" }, { "<leader>S", group = "Save/Source" }, { "<leader>w", group = "Which-key" }, diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/macro.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/macro.lua index bd0af30..6450625 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/macro.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/macro.lua @@ -1,42 +1,172 @@ return { - "ecthelionvi/NeoComposer.nvim", - dependencies = { "kkharji/sqlite.lua" }, - opts = {}, - config = function() - require("NeoComposer").setup({ - notify = true, - delay_timer = 150, - queue_most_recent = false, - window = { - width = 80, - height = 10, - border = "rounded", - winhl = { - Normal = "ComposerNormal", + -- { + -- "kr40/nvim-macros", + -- lazy = false, + -- cmd = { "MacroSave", "MacroYank", "MacroSelect", "MacroDelete" }, + -- opts = {}, + -- config = function() + -- require("nvim-macros").setup({ + -- json_file_path = vim.fn.expand("~/.local/share/thesiah/macros.json"), -- Location where the macros will be stored + -- default_macro_register = "q", -- Use as default register for :MacroYank and :MacroSave and :MacroSelect Raw functions + -- json_formatter = "none", -- can be "none" | "jq" | "yq" used to pretty print the json file (jq or yq must be installed!) + -- }) + -- vim.keymap.set("n", "yQ", ":MacroYank<CR>", { desc = "Yank macro" }) + -- vim.keymap.set("n", "<leader>wQ", ":MacroSave<CR>", { desc = "Save macro" }) + -- vim.keymap.set("n", "<leader>fQ", ":MacroSelect<CR>", { desc = "Search macro" }) + -- vim.keymap.set("n", "<leader>xQ", ":MacroDelete<CR>", { desc = "Delete macro" }) + -- end, + -- }, + -- { + -- "desdic/macrothis.nvim", + -- opts = {}, + -- config = function() + -- require("macrothis").setup({ + -- datafile = (function() + -- local path = vim.fn.expand("~/.local/share/thesiah/macros.json") + -- + -- -- Create directory if it doesn't exist + -- local dir = vim.fn.fnamemodify(path, ":h") + -- if vim.fn.isdirectory(dir) == 0 then + -- vim.fn.mkdir(dir, "p") + -- end + -- + -- -- Create file if it doesn't exist or is empty + -- if vim.fn.filereadable(path) == 0 or vim.fn.getfsize(path) == 0 then + -- local file = io.open(path, "w") + -- if file then + -- file:write("[]") + -- file:close() + -- end + -- end + -- + -- return path + -- end)(), + -- run_register = "Q", -- content of register z is replaced when running/editing a macro + -- editor = { -- Edit window + -- width = 100, + -- height = 2, + -- style = "minimal", + -- border = "rounded", + -- }, + -- clipboard_register = '"', + -- default_register = "q", -- Use this register when loading a macro (will never prompt for register if set) + -- }) + -- require("telescope").load_extension("macrothis") + -- vim.keymap.set("n", "<leader>fQ", ":Telescope macrothis<CR>", { desc = "Find macro" }) + -- end, + -- keys = { + -- { + -- "<Leader>dQ", + -- function() + -- require("macrothis").delete() + -- end, + -- desc = "Delete macro", + -- }, + -- { + -- "<Leader>eQ", + -- function() + -- require("macrothis").edit() + -- end, + -- desc = "Edit macro", + -- }, + -- { + -- "<Leader>lQ", + -- function() + -- require("macrothis").load() + -- end, + -- desc = "Load macro", + -- }, + -- { + -- "<Leader>rnQ", + -- function() + -- require("macrothis").rename() + -- end, + -- desc = "Rename macro", + -- }, + -- { + -- "<Leader>rQ", + -- function() + -- require("macrothis").quickfix() + -- end, + -- desc = "Run macro on all files in quickfix", + -- }, + -- { + -- "<Leader>rq", + -- function() + -- require("macrothis").run() + -- end, + -- desc = "Run macro", + -- }, + -- { + -- "<Leader>wQ", + -- function() + -- require("macrothis").save() + -- end, + -- desc = "Save macro", + -- }, + -- { + -- "<Leader>eR", + -- function() + -- require("macrothis").register() + -- end, + -- desc = "Edit register", + -- }, + -- { + -- "yr", + -- function() + -- require("macrothis").copy_register_printable() + -- end, + -- desc = "Copy register as printable", + -- }, + -- { + -- "yq", + -- function() + -- require("macrothis").copy_macro_printable() + -- end, + -- desc = "Copy macro as printable", + -- }, + -- }, + -- }, + { + "ecthelionvi/NeoComposer.nvim", + dependencies = { "kkharji/sqlite.lua" }, + opts = {}, + config = function() + require("NeoComposer").setup({ + notify = true, + delay_timer = 150, + queue_most_recent = false, + window = { + width = 80, + height = 10, + border = "rounded", + winhl = { + Normal = "ComposerNormal", + }, }, - }, - colors = { - bg = "NONE", - fg = "#ff9e64", - red = "#ec5f67", - blue = "#5fb3b3", - green = "#99c794", - }, - keymaps = { - play_macro = "Q", - yank_macro = "yq", - stop_macro = "cq", - toggle_record = "q", - cycle_next = "<m-n>", - cycle_prev = "<m-p>", - toggle_macro_menu = "<m-q>", - }, - }) + colors = { + bg = "NONE", + fg = "#ff9e64", + red = "#ec5f67", + blue = "#5fb3b3", + green = "#99c794", + }, + keymaps = { + play_macro = "Q", + yank_macro = "yq", + stop_macro = "cq", + toggle_record = "q", + cycle_next = "<m-n>", + cycle_prev = "<m-p>", + toggle_macro_menu = "<m-q>", + }, + }) - require("telescope").load_extension("macros") + require("telescope").load_extension("macros") - vim.keymap.set("n", "<leader>fQ", ":Telescope macros<CR>", { desc = "Search macros" }) - vim.keymap.set("n", "<leader>eQ", ":EditMacros<CR>", { desc = "Edit macros" }) - vim.keymap.set("n", "<leader>xQ", ":ClearNeoComposer<CR>", { desc = "Clear macros" }) - end, + vim.keymap.set("n", "<leader>fQ", ":Telescope macros<CR>", { desc = "Search macros" }) + vim.keymap.set("n", "<leader>eQ", ":EditMacros<CR>", { desc = "Edit macros" }) + vim.keymap.set("n", "<leader>xQ", ":ClearNeoComposer<CR>", { desc = "Clear macros" }) + end, + }, } |
