Skip to content

Commit

Permalink
feat
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Mar 8, 2024
1 parent cb2bc12 commit 4b354e6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lua/dotvim/packages/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,39 @@ return {
opts.filetypes_denylist = vim.tbl_keys(ret)
end,
},
{
"project.nvim",
event = {
"BufReadPost",
"BufNewFile",
},
opts = function(_, opts)
---@type dora.lib
local lib = require("dora.lib")
---@type dotvim.utils
local Utils = require("dotvim.utils")
opts.manual_mode = true
opts.patterns = Utils.tbl.merge_array(opts.patterns, {
"BLADE_ROOT",
"blast.json",
".git",
"_darcs",
".hg",
".bzr",
".svn",
"Makefile",
"package.json",
"HomePage.md", -- for my personal obsidian notes
})
opts.exclude_dirs = Utils.tbl.merge_array(opts.exclude_dirs, {
"~/.cargo/*",
})
opts.silent_chdir = false
end,
config = function(_, opts)
opts = opts or {}
require("project_nvim").setup(opts)
end,
},
},
}
3 changes: 3 additions & 0 deletions lua/dotvim/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ local M = {}
---@type dotvim.utils.ansi
M.ansi = require("dotvim.utils.ansi")

---@type dotvim.utils.tbl
M.tbl = require("dotvim.utils.tbl")

return M
21 changes: 21 additions & 0 deletions lua/dotvim/utils/tbl.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---@class dotvim.utils.tbl
local M = {}

---@generic T
---@param t1? T[]
---@param t2? T[]
---@return T[]
function M.merge_array(t1, t2)
if t1 == nil then
return t2 or {}
end
if t2 == nil then
return t1
end
local res = {}
vim.list_extend(res, t1)
vim.list_extend(res, t2)
return res
end

return M

0 comments on commit 4b354e6

Please sign in to comment.