From cde3381d4723760b2e6ad89134f241e97501ac77 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sat, 21 Jun 2025 13:57:40 +0900 Subject: updates --- .../TheSiahxyz/lua/TheSiahxyz/core/keymaps.lua | 31 ++- .../TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua | 56 ++-- .../TheSiahxyz/lua/TheSiahxyz/plugins/harpoon2.lua | 9 +- .../TheSiahxyz/lua/TheSiahxyz/plugins/init.lua | 4 + .../TheSiahxyz/lua/TheSiahxyz/plugins/keys.lua | 5 + .../TheSiahxyz/lua/TheSiahxyz/plugins/macro.lua | 290 ++++++++++----------- .../lua/TheSiahxyz/plugins/telescope.lua | 7 +- .../TheSiahxyz/lua/TheSiahxyz/plugins/wiki.lua | 2 +- .../TheSiahxyz/lua/TheSiahxyz/utils/utils.lua | 10 +- ar/.config/mimeapps.list | 11 +- ar/.config/vim/init.vim | 7 +- 11 files changed, 228 insertions(+), 204 deletions(-) (limited to 'ar') diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/core/keymaps.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/core/keymaps.lua index c8ae8f2..7b3a948 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/core/keymaps.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/core/keymaps.lua @@ -12,18 +12,26 @@ vim.keymap.set("n", "a0", ":.!figlet -w 200 -f shadow", { desc = "As -- Buffers vim.keymap.set({ "n", "v", "x", "t" }, "", "bd!", { desc = "Delete buffer" }) -vim.keymap.set({ "i", "n", "t" }, "", "bprevious", { desc = "Previous buffer" }) -vim.keymap.set({ "i", "n", "t" }, "", "bnext", { desc = "Next buffer" }) +-- vim.keymap.set({ "i", "n", "t" }, "", "bprevious", { desc = "Previous buffer" }) +-- vim.keymap.set({ "i", "n", "t" }, "", "bnext", { desc = "Next buffer" }) vim.keymap.set({ "n", "t" }, "", "bprevious", { desc = "Previous buffer" }) vim.keymap.set({ "n", "t" }, "", "bnext", { desc = "Next buffer" }) vim.keymap.set("n", "", "e #", { desc = "Switch to last buffer" }) vim.keymap.set({ "n", "v", "x", "t" }, "bd", ":bd", { desc = "Close buffer" }) vim.keymap.set({ "n", "v", "x", "t" }, "BD", ":bd!", { desc = "Force close buffer" }) vim.keymap.set("n", "bn", "enew", { desc = "Open new buffer" }) -vim.keymap.set("n", "bc", "e!", { desc = "Clear edit" }) +vim.keymap.set({ "n", "i" }, "", function() + if not vim.bo.modified then + return + end + local choice = vim.fn.confirm("Discard changes and reload file?", "&Yes\n&No", 2) + if choice == 1 then + vim.cmd("e!") + end +end, { desc = "Confirm and reload file" }) vim.keymap.set({ "i", "x", "n", "s" }, "", "w", { desc = "Save current buffer" }) -vim.keymap.set({ "n", "v" }, "wq", "wq", { desc = "Save current buffer and quit" }) -vim.keymap.set({ "n", "v" }, "WQ", "wqa", { desc = "Save all buffers and quit" }) +vim.keymap.set({ "n", "v" }, "ZZ", "wq", { desc = "Save current buffer and quit" }) +vim.keymap.set({ "n", "v" }, "ZA", "wqa", { desc = "Save all buffers and quit" }) vim.keymap.set({ "n", "v" }, "qq", "q!", { desc = "Force quit" }) vim.keymap.set({ "n", "v" }, "QQ", "qa!", { desc = "Force quit all" }) vim.keymap.set("n", "rnf", function() @@ -369,15 +377,6 @@ vim.keymap.set("n", "cx", "!chmod +x %", { silent = true, desc -- Remap Default vim.keymap.set("i", "jk", "", { noremap = true, silent = true, desc = "Escape to normal mode" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Escape to normal mode" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Insert at beginning of line" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Move to end of line" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Move left" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Move right" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Move down" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "Move up" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "New line above" }) -vim.keymap.set("i", "", "", { noremap = true, silent = true, desc = "New line below" }) vim.keymap.set("n", "", ":", { noremap = true, desc = "Enter command mode" }) vim.keymap.set("n", "J", "mzJ`z", { noremap = true, desc = "Join lines and keep cursor position" }) vim.keymap.set("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result and center" }) @@ -403,8 +402,8 @@ vim.keymap.set("n", "", function() end, { noremap = true, silent = true, desc = "Scroll up and center" }) -- vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Scroll down and center" }) -- vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Scroll up and center" }) -vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Page up and center" }) -vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Page down and center" }) +-- vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Page up and center" }) +-- vim.keymap.set("n", "", "zz", { noremap = true, silent = true, desc = "Page down and center" }) vim.keymap.set("n", "{", "{zz", { noremap = true, silent = true, desc = "Move to previous paragraph and center" }) vim.keymap.set("n", "}", "}zz", { noremap = true, silent = true, desc = "Move to next paragraph and center" }) vim.keymap.set("n", "G", "Gzz", { noremap = true, silent = true, desc = "Go to bottom of file and center" }) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index 45aa240..baab1f0 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -127,29 +127,29 @@ return { require("gp").setup(conf) -- Setup shortcuts here (see Usage > Shortcuts in the Documentation/Readme) - vim.keymap.set({ "n", "i" }, "Gc", "GpChatNew", keymapOptions("New chat")) - vim.keymap.set({ "n", "i" }, "Gb", "GpBufferChatNew", keymapOptions("New buffer chat")) - vim.keymap.set({ "n", "i" }, "Gt", "GpChatToggle", keymapOptions("Toggle chat")) - vim.keymap.set({ "n", "i" }, "Gf", "GpChatFinder", keymapOptions("Chat finder")) + vim.keymap.set("n", "Gc", "GpChatNew", keymapOptions("New chat")) + vim.keymap.set("n", "Gb", "GpBufferChatNew", keymapOptions("New buffer chat")) + vim.keymap.set("n", "Gt", "GpChatToggle", keymapOptions("Toggle chat")) + vim.keymap.set("n", "Gf", "GpChatFinder", keymapOptions("Chat finder")) vim.keymap.set("v", "Gc", ":'<,'>GpChatNew", keymapOptions("Chat new")) vim.keymap.set("v", "Gb", ":'<,'>GpBufferChatNew", keymapOptions("Buffer chat new")) vim.keymap.set("v", "Gp", ":'<,'>GpChatPaste", keymapOptions("Chat paste")) vim.keymap.set("v", "Gt", ":'<,'>GpChatToggle", keymapOptions("Toggle chat")) - vim.keymap.set({ "n", "i" }, "Gh", "gpchatnew split", keymapOptions("New chat split")) - vim.keymap.set({ "n", "i" }, "Gv", "gpchatnew vsplit", keymapOptions("New chat vsplit")) - vim.keymap.set({ "n", "i" }, "Gn", "gpchatnew tabnew", keymapOptions("New chat tabnew")) + vim.keymap.set("n", "Gh", "gpchatnew split", keymapOptions("New chat split")) + vim.keymap.set("n", "Gv", "gpchatnew vsplit", keymapOptions("New chat vsplit")) + vim.keymap.set("n", "Gn", "gpchatnew tabnew", keymapOptions("New chat tabnew")) vim.keymap.set("v", "Gh", ":'<,'>GpChatNew split", keymapOptions("Chat new split")) vim.keymap.set("v", "Gv", ":'<,'>GpChatNew vsplit", keymapOptions("Chat new vsplit")) vim.keymap.set("v", "Gn", ":'<,'>GpChatNew tabnew", keymapOptions("Chat new tabnew")) -- Prompt commands - vim.keymap.set({ "n", "i" }, "Gw", "GpRewrite", keymapOptions("Inline rewrite")) - vim.keymap.set({ "n", "i" }, "Gr", "GpCodeReview", keymapOptions("Code review")) - vim.keymap.set({ "n", "i" }, "G]", "GpAppend", keymapOptions("Append (after)")) - vim.keymap.set({ "n", "i" }, "G[", "GpPrepend", keymapOptions("Prepend (before)")) + vim.keymap.set("n", "Gw", "GpRewrite", keymapOptions("Inline rewrite")) + vim.keymap.set("n", "Gr", "GpCodeReview", keymapOptions("Code review")) + vim.keymap.set("n", "G]", "GpAppend", keymapOptions("Append (after)")) + vim.keymap.set("n", "G[", "GpPrepend", keymapOptions("Prepend (before)")) vim.keymap.set("v", "Gw", ":'<,'>GpRewrite", keymapOptions("Rewrite")) vim.keymap.set("v", "Gr", ":'<,'>GpCodeReview", keymapOptions("Code review")) @@ -157,11 +157,11 @@ return { vim.keymap.set("v", "G[", ":'<,'>GpPrepend", keymapOptions("Prepend (before)")) vim.keymap.set("v", "Gi", ":'<,'>GpImplement", keymapOptions("Implement selection")) - vim.keymap.set({ "n", "i" }, "Ggp", "GpPopup", keymapOptions("Popup")) - vim.keymap.set({ "n", "i" }, "Gge", "GpEnew", keymapOptions("GpEnew")) - vim.keymap.set({ "n", "i" }, "Ggc", "GpNew", keymapOptions("GpNew")) - vim.keymap.set({ "n", "i" }, "Ggv", "GpVnew", keymapOptions("GpVnew")) - vim.keymap.set({ "n", "i" }, "Ggn", "GpTabnew", keymapOptions("GpTabnew")) + vim.keymap.set("n", "Ggp", "GpPopup", keymapOptions("Popup")) + vim.keymap.set("n", "Gge", "GpEnew", keymapOptions("GpEnew")) + vim.keymap.set("n", "Ggc", "GpNew", keymapOptions("GpNew")) + vim.keymap.set("n", "Ggv", "GpVnew", keymapOptions("GpVnew")) + vim.keymap.set("n", "Ggn", "GpTabnew", keymapOptions("GpTabnew")) vim.keymap.set("v", "Ggp", ":'<,'>GpPopup", keymapOptions("Popup")) vim.keymap.set("v", "Gge", ":'<,'>GpEnew", keymapOptions("GpEnew")) @@ -169,29 +169,29 @@ return { vim.keymap.set("v", "Ggv", ":'<,'>GpVnew", keymapOptions("GpVnew")) vim.keymap.set("v", "Ggn", ":'<,'>GpTabnew", keymapOptions("GpTabnew")) - vim.keymap.set({ "n", "i" }, "Gx", "GpContext", keymapOptions("Toggle context")) + vim.keymap.set("n", "Gx", "GpContext", keymapOptions("Toggle context")) vim.keymap.set("v", "Gx", ":'<,'>GpContext", keymapOptions("Toggle context")) - vim.keymap.set({ "n", "i", "v", "x" }, "Ggs", "GpStop", keymapOptions("Stop")) - vim.keymap.set({ "n", "i", "v", "x" }, "Gg]", "GpNextAgent", keymapOptions("Next agent")) + vim.keymap.set({ "n", "v", "x" }, "Ggs", "GpStop", keymapOptions("Stop")) + vim.keymap.set({ "n", "v", "x" }, "Gg]", "GpNextAgent", keymapOptions("Next agent")) -- optional Whisper commands with prefix w - vim.keymap.set({ "n", "i" }, "GWw", "GpWhisper", keymapOptions("Whisper")) + vim.keymap.set("n", "GWw", "GpWhisper", keymapOptions("Whisper")) vim.keymap.set("v", "GWw", ":'<,'>GpWhisper", keymapOptions("Whisper")) - vim.keymap.set({ "n", "i" }, "GWr", "GpWhisperRewrite", keymapOptions("Inline rewrite")) - vim.keymap.set({ "n", "i" }, "GW]", "GpWhisperAppend", keymapOptions("Append (after)")) - vim.keymap.set({ "n", "i" }, "GW[", "GpWhisperPrepend", keymapOptions("Prepend (before) ")) + vim.keymap.set("n", "GWr", "GpWhisperRewrite", keymapOptions("Inline rewrite")) + vim.keymap.set("n", "GW]", "GpWhisperAppend", keymapOptions("Append (after)")) + vim.keymap.set("n", "GW[", "GpWhisperPrepend", keymapOptions("Prepend (before) ")) vim.keymap.set("v", "GWr", ":'<,'>GpWhisperRewrite", keymapOptions("Rewrite")) vim.keymap.set("v", "GW]", ":'<,'>GpWhisperAppend", keymapOptions("Append (after)")) vim.keymap.set("v", "GW[", ":'<,'>GpWhisperPrepend", keymapOptions("Prepend (before)")) - vim.keymap.set({ "n", "i" }, "GWp", "GpWhisperPopup", keymapOptions("Popup")) - vim.keymap.set({ "n", "i" }, "GWe", "GpWhisperEnew", keymapOptions("Enew")) - vim.keymap.set({ "n", "i" }, "GWc", "GpWhisperNew", keymapOptions("New")) - vim.keymap.set({ "n", "i" }, "GWv", "GpWhisperVnew", keymapOptions("Vnew")) - vim.keymap.set({ "n", "i" }, "GWn", "GpWhisperTabnew", keymapOptions("Tabnew")) + vim.keymap.set("n", "GWp", "GpWhisperPopup", keymapOptions("Popup")) + vim.keymap.set("n", "GWe", "GpWhisperEnew", keymapOptions("Enew")) + vim.keymap.set("n", "GWc", "GpWhisperNew", keymapOptions("New")) + vim.keymap.set("n", "GWv", "GpWhisperVnew", keymapOptions("Vnew")) + vim.keymap.set("n", "GWn", "GpWhisperTabnew", keymapOptions("Tabnew")) vim.keymap.set("v", "GWp", ":'<,'>GpWhisperPopup", keymapOptions("Popup")) vim.keymap.set("v", "GWe", ":'<,'>GpWhisperEnew", keymapOptions("Enew")) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/harpoon2.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/harpoon2.lua index c68f385..24aa623 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/harpoon2.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/harpoon2.lua @@ -51,29 +51,30 @@ return { desc = "Add buffer to harpoon list", }, { - "hi", + "ht", function() require("harpoon"):list():prepend() end, desc = "Prepend buffer to harpoon list", }, { - "", + "", function() local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end, + mode = { "n", "i" }, desc = "Open harpoon list menu", }, { - "", + "", function() require("harpoon"):list():prev({ ui_nav_wrap = false }) end, desc = "Previous harpoon list", }, { - "", + "", function() require("harpoon"):list():next({ ui_nav_wrap = false }) end, diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/init.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/init.lua index 0bcf162..30fce3b 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/init.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/init.lua @@ -66,6 +66,10 @@ return { }, }) + vim.keymap.set("i", "", "lua require('tmux').move_left()", { desc = "Move to left" }) + vim.keymap.set("i", "", "lua require('tmux').move_right()", { desc = "Move to right" }) + vim.keymap.set("i", "", "lua require('tmux').move_bottom()", { desc = "Move to bottom" }) + vim.keymap.set("i", "", "lua require('tmux').move_top()", { desc = "Move to top" }) vim.keymap.set("n", "", function() require("tmux").resize_left() end, { desc = "Decrease window width" }) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/keys.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/keys.lua index b263414..4af0ecf 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/keys.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/keys.lua @@ -83,6 +83,11 @@ return { { "g;", desc = "Last change" }, { "Q", group = "Quit all" }, }, + { + mode = { "i" }, + { "", desc = "Execute one command" }, + { "", desc = "Paste from registers" }, + }, }) end, keys = { diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/macro.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/macro.lua index 2af1b49..b69d000 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/macro.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/macro.lua @@ -16,157 +16,157 @@ return { -- vim.keymap.set("n", "xQ", ":MacroDelete", { 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", "fQ", ":Telescope macrothis", { desc = "Find macro" }) - -- end, - -- keys = { - -- { - -- "dQ", - -- function() - -- require("macrothis").delete() - -- end, - -- desc = "Delete macro", - -- }, - -- { - -- "eQ", - -- function() - -- require("macrothis").edit() - -- end, - -- desc = "Edit macro", - -- }, - -- { - -- "lQ", - -- function() - -- require("macrothis").load() - -- end, - -- desc = "Load macro", - -- }, - -- { - -- "rnQ", - -- function() - -- require("macrothis").rename() - -- end, - -- desc = "Rename macro", - -- }, - -- { - -- "rQ", - -- function() - -- require("macrothis").quickfix() - -- end, - -- desc = "Run macro on all files in quickfix", - -- }, - -- { - -- "rq", - -- function() - -- require("macrothis").run() - -- end, - -- desc = "Run macro", - -- }, - -- { - -- "wQ", - -- function() - -- require("macrothis").save() - -- end, - -- desc = "Save macro", - -- }, - -- { - -- "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" }, + "desdic/macrothis.nvim", opts = {}, config = function() - require("NeoComposer").setup({ - notify = true, - delay_timer = 150, - queue_most_recent = false, - window = { - width = 80, - height = 10, + 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", - 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 = "", - cycle_prev = "", - toggle_macro_menu = "", }, + clipboard_register = '"', + default_register = "q", -- Use this register when loading a macro (will never prompt for register if set) }) - - require("telescope").load_extension("macros") - - vim.keymap.set("n", "sm", ":Telescope macros", { desc = "Search macros" }) - vim.keymap.set("n", "em", ":EditMacros", { desc = "Edit macros" }) - vim.keymap.set("n", "xm", ":ClearNeoComposer", { desc = "Clear macros" }) + require("telescope").load_extension("macrothis") + vim.keymap.set("n", "fq", ":Telescope macrothis", { desc = "Find macro" }) end, + keys = { + { + "dq", + function() + require("macrothis").delete() + end, + desc = "Delete macro", + }, + { + "eq", + function() + require("macrothis").edit() + end, + desc = "Edit macro", + }, + { + "lq", + function() + require("macrothis").load() + end, + desc = "Load macro", + }, + { + "rnq", + function() + require("macrothis").rename() + end, + desc = "Rename macro", + }, + { + "rQ", + function() + require("macrothis").quickfix() + end, + desc = "Run macro on all files in quickfix", + }, + { + "rq", + function() + require("macrothis").run() + end, + desc = "Run macro", + }, + { + "wq", + function() + require("macrothis").save() + end, + desc = "Save macro", + }, + { + 'e"', + function() + require("macrothis").register() + end, + desc = "Edit register", + }, + { + 'y"', + 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 = "", + -- cycle_prev = "", + -- toggle_macro_menu = "", + -- }, + -- }) + -- + -- require("telescope").load_extension("macros") + -- + -- vim.keymap.set("n", "sm", ":Telescope macros", { desc = "Search macros" }) + -- vim.keymap.set("n", "em", ":EditMacros", { desc = "Edit macros" }) + -- vim.keymap.set("n", "xm", ":ClearNeoComposer", { desc = "Clear macros" }) + -- end, + -- }, } diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua index 0ec51f1..956601f 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/telescope.lua @@ -641,7 +641,7 @@ return { }) -- find - vim.keymap.set({ "i", "n" }, "", function() + vim.keymap.set({ "i", "n" }, "", function() require("telescope.builtin").buffers({ sort_mru = true, sort_lastused = true, @@ -661,6 +661,9 @@ return { vim.keymap.set("n", "fd", function() require("telescope.builtin").find_files({ cwd = vim.fn.expand("~/.dotfiles") }) end, { desc = "Find dotfiles files" }) + vim.keymap.set({ "n", "i" }, "", function() + require("telescope.builtin").find_files() + end, { desc = "Find files" }) vim.keymap.set("n", "ff", function() require("telescope.builtin").find_files() end, { desc = "Find files" }) @@ -981,7 +984,7 @@ return { require("telescope").load_extension("frecency") - vim.keymap.set("n", "fq", function() + vim.keymap.set("n", "fr", function() require("telescope").extensions.frecency.frecency({ workspace = "CWD", }) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/wiki.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/wiki.lua index 86fcd52..e856256 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/wiki.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/wiki.lua @@ -160,11 +160,11 @@ return { desc = "Insert image link", }, { - mode = "i", "]]", function() require("telekasten").insert_link() end, + mode = "i", desc = "Insert link", }, }, diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/utils/utils.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/utils/utils.lua index f50d22f..8b9b85b 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/utils/utils.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/utils/utils.lua @@ -30,7 +30,7 @@ function M.insert_file_path() local action_state = require("telescope.actions.state") require("telescope.builtin").find_files({ - cwd = "~/.config", -- Set the directory to search + cwd = vim.fn.getcwd(), -- Set the directory to search attach_mappings = function(_, map) map("i", "", function(prompt_bufnr) local selected_file = action_state.get_selected_entry(prompt_bufnr).path @@ -64,7 +64,13 @@ vim.api.nvim_set_keymap( "i", "", "lua require('TheSiahxyz.utils.utils').insert_file_path()", - { noremap = true, silent = true } + { noremap = true, silent = true, desc = "Insert file path/name" } +) +vim.api.nvim_set_keymap( + "n", + "vf", + "lua require('TheSiahxyz.utils.utils').insert_file_path()", + { noremap = true, silent = true, desc = "Insert file path/name" } ) function M.create_floating_scratch(content) -- Get editor dimensions diff --git a/ar/.config/mimeapps.list b/ar/.config/mimeapps.list index 0acd48c..25c942f 100644 --- a/ar/.config/mimeapps.list +++ b/ar/.config/mimeapps.list @@ -3,18 +3,22 @@ # xdg-open will use these settings to determine how to open filetypes. # These .desktop entries can also be seen and changed in ~/.local/share/applications/ -application/pdf=firefox.desktop; +application/json=librewolf.desktop;firefox.desktop; +application/pdf=pdf.desktop; application/postscript=pdf.desktop; application/rss+xml=rss.desktop; application/x-bittorrent=torrent.desktop; +application/x-xpinstall=librewolf.desktop;firefox.desktop; +application/xhtml+xml=librewolf.desktop;firefox.desktop; application/vnd.openxmlformats-officedocument.presentationml.presentation=office.desktop; +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=csv.desktop; application/vnd.openxmlformats-officedocument.wordprocessingml.document=office.desktop; inode/directory=file.desktop; image/jpeg=img.desktop; image/gif=img.desktop; image/png=img.desktop; +image/webp=nsxiv.desktop; text/csv=csv.desktop; -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=csv.desktop; text/html=html.desktop; text/markdown=slide.desktop; text/plain=text.desktop; @@ -23,7 +27,8 @@ text/x-shellscript=text.desktop; text/xml=html.desktop; video/mp4=video.desktop; video/x-matroska=video.desktop; +x-scheme-handler/http=librewolf.desktop;firefox.desktop; +x-scheme-handler/https=librewolf.desktop;firefox.desktop; x-scheme-handler/lbry=lbry.desktop; x-scheme-handler/mailto=mail.desktop; x-scheme-handler/magnet=torrent.desktop; -image/webp=nsxiv.desktop; diff --git a/ar/.config/vim/init.vim b/ar/.config/vim/init.vim index 2ab5237..c39c130 100644 --- a/ar/.config/vim/init.vim +++ b/ar/.config/vim/init.vim @@ -63,9 +63,10 @@ endif " PLUGINS INIT ----------------------------------------------------------- {{{ -if filereadable(expand("~/.config/vim/plugins.vim")) - silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/vim/plugged/ - source ${XDG_CONFIG_HOME:-$HOME/.config}/vim/plugins.vim +let config_path = empty($XDG_CONFIG_HOME) ? expand("$HOME/.config") : expand("$XDG_CONFIG_HOME") +if filereadable(config_path . "/vim/plugins.vim") + silent! call mkdir(config_path . "/vim/plugged", "p") + execute "source " . config_path . "/vim/plugins.vim" endif " goyo -- cgit v1.2.3