feat: register obsidian.nvim cmp source

This commit is contained in:
Youwen Wu 2024-12-29 15:53:22 -08:00
parent 1becd97d57
commit 4d4c7550eb
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
4 changed files with 20 additions and 3 deletions

View file

@ -175,6 +175,7 @@
lazydev-nvim lazydev-nvim
plenary-nvim plenary-nvim
obsidian-nvim obsidian-nvim
blink-compat
# colorschemes # colorschemes
rose-pine rose-pine

View file

@ -3,6 +3,7 @@ return {
event = "BufEnter", event = "BufEnter",
after = function() after = function()
require("lz.n").trigger_load("blink-ripgrep") require("lz.n").trigger_load("blink-ripgrep")
require("lz.n").trigger_load("blink.compat")
require("blink.cmp").setup({ require("blink.cmp").setup({
keymap = { keymap = {
@ -21,7 +22,7 @@ return {
default = { "lsp", "path", "snippets", "buffer" }, default = { "lsp", "path", "snippets", "buffer" },
per_filetype = { per_filetype = {
lua = { "lazydev", "lsp", "path", "snippets", "buffer" }, lua = { "lazydev", "lsp", "path", "snippets", "buffer" },
markdown = { "lsp", "path", "snippets", "buffer", "markdown" }, markdown = { "lsp", "snippets", "obsidian", "obsidian_new", "obsidian_tags", "path", "buffer", "markdown" },
}, },
providers = { providers = {
ripgrep = { ripgrep = {
@ -34,6 +35,18 @@ return {
score_offset = 100, score_offset = 100,
}, },
markdown = { name = "RenderMarkdown", module = "render-markdown.integ.blink" }, markdown = { name = "RenderMarkdown", module = "render-markdown.integ.blink" },
obsidian = {
name = "obsidian",
module = "blink.compat.source",
},
obsidian_new = {
name = "obsidian_new",
module = "blink.compat.source",
},
obsidian_tags = {
name = "obsidian_tags",
module = "blink.compat.source",
},
}, },
}, },
completion = { completion = {

View file

@ -231,6 +231,7 @@ return {
end, end,
}, },
{ "blink-ripgrep", lazy = true }, { "blink-ripgrep", lazy = true },
{ "blink.compat", lazy = true },
{ {
"lazydev.nvim", "lazydev.nvim",
filetypes = { "lua" }, filetypes = { "lua" },

View file

@ -36,10 +36,12 @@ return {
local workspaces = get_workspaces() local workspaces = get_workspaces()
if #workspaces > 0 then if #workspaces > 0 then
require("obsidian").setup({ local opts = {
ui = { enable = false }, ui = { enable = false },
workspaces = workspaces, workspaces = workspaces,
}) completion = { nvim_cmp = false },
}
require("obsidian").setup(opts)
end end
end, end,
} }