Add abolish.vim, fix workspace_files function

This commit is contained in:
Alexander Gehrke 2025-11-05 10:23:28 +01:00
parent 0318cf895e
commit a1204e5a90
2 changed files with 17 additions and 10 deletions

View file

@ -6,6 +6,7 @@ return {
"tpope/vim-characterize",
"tpope/vim-commentary",
"tpope/vim-sleuth",
"tpope/vim-abolish",
{ "chrisgrieser/nvim-genghis", dependencies = "stevearc/dressing.nvim", opts = { trashCmd = "rm" } },
@ -29,7 +30,11 @@ return {
"artemave/workspace-diagnostics.nvim",
opts = {
workspace_files = function()
-- try LSP workspace folder first, for repos with multiple subprojects
local project_root = vim.lsp.buf.list_workspace_folders()[1]
if project_root == nil then
project_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
end
local workspace_files = vim.fn.split(vim.fn.system("git ls-files " .. project_root), "\n")
return workspace_files
end,