summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua15
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua2
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/grug-far.lua31
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/lsp.lua28
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua4
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/neo-tree.lua121
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/silicon.lua6
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/stay-centered.lua28
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/virt-column.lua17
9 files changed, 241 insertions, 11 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua
index 861128c..2c33f4f 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua
@@ -64,8 +64,12 @@ autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"checkhealth",
+ "dbout",
+ "gitsigns-blame",
+ "grug-far",
"help",
"lspinfo",
+ "Lazy",
"neotest-output",
"neotest-output-panel",
"neotest-summary",
@@ -94,6 +98,17 @@ autocmd("FileType", {
end,
})
+-- Show LSP diagnostics (inlay hints) in a hover window / popup lamw26wmal
+vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
+ group = augroup("float_diagnostic"),
+ callback = function()
+ vim.diagnostic.open_float(nil, {
+ focus = false,
+ border = "rounded",
+ })
+ end,
+})
+
-- Make it easier to close man-files when opened inline
autocmd("FileType", {
group = augroup("man_close"),
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
index 3788279..1f18b61 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
@@ -56,7 +56,7 @@ return {
end, { desc = "Copy git repository URL to clipboard" })
-- Function to open a repository from the clipboard
- vim.keymap.set("n", "<leader>er", function()
+ vim.keymap.set("n", "<leader>eg", function()
local url = vim.fn.getreg("+") -- Get URL from clipboard
if not url or url == "" then
vim.notify("Clipboard is empty. Copy a valid URL first.", vim.log.levels.WARN)
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/grug-far.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/grug-far.lua
new file mode 100644
index 0000000..6f6ff48
--- /dev/null
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/grug-far.lua
@@ -0,0 +1,31 @@
+return {
+ "MagicDuck/grug-far.nvim",
+ --- Ensure existing keymaps and opts remain unaffected
+ config = function(_, opts)
+ require("grug-far").setup(opts)
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = "grug-far",
+ callback = function()
+ -- Map <Esc> to quit after ensuring we're in normal mode
+ vim.keymap.set({ "i", "n" }, "<Esc>", "<cmd>stopinsert | bd!<CR>", { buffer = true })
+ end,
+ })
+ end,
+ keys = {
+ {
+ "<leader>rp",
+ function()
+ local grug = require("grug-far")
+ local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
+ grug.open({
+ transient = true,
+ prefills = {
+ filesFilter = ext and ext ~= "" and "*." .. ext or nil,
+ },
+ })
+ end,
+ mode = { "n", "v" },
+ desc = "Search and Replace",
+ },
+ },
+}
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/lsp.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/lsp.lua
index c6fc158..b265f5b 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/lsp.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/lsp.lua
@@ -3,8 +3,8 @@ return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
- "williamboman/mason.nvim",
- "williamboman/mason-lspconfig.nvim",
+ "mason-org/mason.nvim",
+ "mason-org/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
@@ -90,6 +90,7 @@ return {
"bashls",
"dockerls",
"docker_compose_language_service",
+ "harper_ls",
"jdtls",
"jsonls",
"lua_ls",
@@ -189,6 +190,23 @@ return {
-- },
})
end,
+ ["harper_ls"] = function()
+ lspconfig.harper_ls.setup({
+ capabilities = capabilities,
+ filetypes = { "markdown", "python" },
+ settings = {
+ ToDoHyphen = false,
+ -- SentenceCapitalization = true,
+ -- SpellCheck = true,
+ isolateEnglish = true,
+ markdown = {
+ -- [ignores this part]()
+ -- [[ also ignores my marksman links ]]
+ IgnoreLinkTitle = true,
+ },
+ },
+ })
+ end,
},
})
@@ -283,7 +301,7 @@ return {
})
vim.diagnostic.config({
- -- update_in_insert = true,
+ update_in_insert = true,
float = {
header = "",
border = "rounded",
@@ -381,8 +399,8 @@ return {
-- "neovim/nvim-lspconfig",
-- event = { "BufReadPre", "BufNewFile" },
-- dependencies = {
- -- "williamboman/mason.nvim",
- -- "williamboman/mason-lspconfig.nvim",
+ -- "mason-org/mason.nvim",
+ -- "mason-org/mason-lspconfig.nvim",
-- "WhoIsSethDaniel/mason-tool-installer.nvim",
-- "hrsh7th/cmp-nvim-lsp",
-- "hrsh7th/cmp-buffer",
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
index 73cde53..ee08c4a 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
@@ -312,7 +312,7 @@ return {
},
keys = {
{
- "<leader>e",
+ "<leader>ee",
function()
if not MiniFiles.close() then
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
@@ -321,7 +321,7 @@ return {
desc = "Open mini.files",
},
{
- "<leader>E",
+ "<leader>eE",
function()
require("mini.files").open(vim.uv.cwd(), true)
end,
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/neo-tree.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/neo-tree.lua
new file mode 100644
index 0000000..b21b130
--- /dev/null
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/neo-tree.lua
@@ -0,0 +1,121 @@
+return {
+ {
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
+ "MunifTanjim/nui.nvim",
+ { "3rd/image.nvim", opts = {} }, -- Optional image support in preview window: See `# Preview Mode` for more information
+ },
+ lazy = false, -- neo-tree will lazily load itself
+ ---@module "neo-tree"
+ ---@type neotree.Config?
+ opts = {
+ filesystem = {
+ follow_current_file = { enabled = false },
+ commands = {
+ -- over write default 'delete' command to 'trash'.
+ delete = function(state)
+ if vim.fn.executable("trash") == 0 then
+ vim.api.nvim_echo({
+ { "- Trash utility not installed. Make sure to install it first\n", nil },
+ { "- In macOS run `brew install trash`\n", nil },
+ { "- Or delete the `custom delete command` section in neo-tree", nil },
+ }, false, {})
+ return
+ end
+ local inputs = require("neo-tree.ui.inputs")
+ local path = state.tree:get_node().path
+ local msg = "Are you sure you want to trash " .. path
+ inputs.confirm(msg, function(confirmed)
+ if not confirmed then
+ return
+ end
+
+ vim.fn.system({ "trash", vim.fn.fnameescape(path) })
+ require("neo-tree.sources.manager").refresh(state.name)
+ end)
+ end,
+ -- Overwrite default 'delete_visual' command to 'trash' x n.
+ delete_visual = function(state, selected_nodes)
+ if vim.fn.executable("trash") == 0 then
+ vim.api.nvim_echo({
+ { "- Trash utility not installed. Make sure to install it first\n", nil },
+ { "- In macOS run `brew install trash`\n", nil },
+ { "- Or delete the `custom delete command` section in neo-tree", nil },
+ }, false, {})
+ return
+ end
+ local inputs = require("neo-tree.ui.inputs")
+
+ -- Function to get the count of items in a table
+ local function GetTableLen(tbl)
+ local len = 0
+ for _ in pairs(tbl) do
+ len = len + 1
+ end
+ return len
+ end
+
+ local count = GetTableLen(selected_nodes)
+ local msg = "Are you sure you want to trash " .. count .. " files?"
+ inputs.confirm(msg, function(confirmed)
+ if not confirmed then
+ return
+ end
+ for _, node in ipairs(selected_nodes) do
+ vim.fn.system({ "trash", vim.fn.fnameescape(node.path) })
+ end
+ require("neo-tree.sources.manager").refresh(state.name)
+ end)
+ end,
+ },
+ },
+ },
+ keys = {
+ { "<leader>e", false },
+ { "<leader>E", false },
+ {
+ "<leader>en",
+ function()
+ local buf_name = vim.api.nvim_buf_get_name(0)
+ -- Function to check if NeoTree is open in any window
+ local function is_neo_tree_open()
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
+ local buf = vim.api.nvim_win_get_buf(win)
+ if vim.bo[buf].filetype == "neo-tree" then
+ return true
+ end
+ end
+ return false
+ end
+ -- Check if the current file exists
+ if
+ vim.fn.filereadable(buf_name) == 1
+ or vim.fn.isdirectory(vim.fn.fnamemodify(buf_name, ":p:h")) == 1
+ then
+ if is_neo_tree_open() then
+ -- Close NeoTree if it's open
+ vim.cmd("Neotree close")
+ else
+ -- Open NeoTree and reveal the current file
+ vim.cmd("Neotree reveal")
+ end
+ else
+ -- If the file doesn't exist, execute the logic for <leader>R
+ require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
+ end
+ end,
+ desc = "Open neo-tree",
+ },
+ {
+ "<leader>eN",
+ function()
+ require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
+ end,
+ desc = "Open neo-tree (cwd)",
+ },
+ },
+ },
+}
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/silicon.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/silicon.lua
index ed63558..f5bd3fa 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/silicon.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/silicon.lua
@@ -111,27 +111,27 @@ return {
},
keys = {
{
- mode = "v",
"<leader>sc",
function()
require("nvim-silicon").clip()
end,
+ mode = "v",
desc = "Copy code screenshot to clipboard",
},
{
- mode = "v",
"<leader>sf",
function()
require("nvim-silicon").file()
end,
+ mode = "v",
desc = "Save code screenshot as file",
},
{
- mode = "v",
"<leader>ss",
function()
require("nvim-silicon").shoot()
end,
+ mode = "v",
desc = "Create code screenshot",
},
},
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/stay-centered.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/stay-centered.lua
new file mode 100644
index 0000000..b64880b
--- /dev/null
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/stay-centered.lua
@@ -0,0 +1,28 @@
+return {
+ "arnamak/stay-centered.nvim",
+ lazy = false,
+ config = function()
+ require("stay-centered").setup({
+ -- The filetype is determined by the vim filetype, not the file extension. In order to get the filetype, open a file and run the command:
+ -- :lua print(vim.bo.filetype)
+ skip_filetypes = {},
+ -- Set to false to disable by default
+ enabled = true,
+ -- allows scrolling to move the cursor without centering, default recommended
+ allow_scroll_move = true,
+ -- temporarily disables plugin on left-mouse down, allows natural mouse selection
+ -- try disabling if plugin causes lag, function uses vim.on_key
+ disable_on_mouse = false,
+ })
+ end,
+ keys = {
+ {
+ "<leader>zs",
+ function()
+ require("stay-centered").toggle()
+ end,
+ mode = { "n", "v" },
+ desc = "Toggle stay-centered.nvim",
+ },
+ },
+}
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/virt-column.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/virt-column.lua
new file mode 100644
index 0000000..cadc77c
--- /dev/null
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/virt-column.lua
@@ -0,0 +1,17 @@
+return {
+ "lukas-reineke/virt-column.nvim",
+ opts = {
+ -- char = "|",
+ -- char = "",
+ -- char = "┇",
+ -- char = "║",
+ -- char = "∶",
+ -- char = "∷",
+ char = "⋮",
+ -- char = "",
+ -- char = "󰇙",
+ -- char = "",
+ -- char = "󰮾",
+ virtcolumn = "80",
+ },
+}