Skip to content

Commit

Permalink
fix(nvim): install obsidian if local setup
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Mar 18, 2024
1 parent 1ba3fdc commit f1b22dd
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions config/.config/nvim/lua/eden/mod/editor.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
return {
local spec = {
-- file explorer
{
"nvim-neo-tree/neo-tree.nvim",
Expand Down Expand Up @@ -94,14 +94,6 @@ return {
},
},

{
"epwalsh/obsidian.nvim",
lazy = true,
ft = "markdown",
dependencies = { "nvim-lua/plenary.nvim" },
config = function() require("obsidian").setup({}) end,
},

-- references
{
"RRethy/vim-illuminate",
Expand Down Expand Up @@ -320,3 +312,32 @@ return {
end,
},
}

if vim.g.obsidian_workspace ~= nil then
-- Example:
-- vim.api.nvim_create_autocmd("User", {
-- group = vim.api.nvim_create_augroup("eden_local", { clear = true }),
-- pattern = "EdenLocalPre",
-- callback = function()
-- print("This is something else")
-- print("Again")
-- vim.g.obsidian_workspace = { {
-- name = "Codex",
-- path = "~/vaults/Codex/",
-- } }
-- end,
-- })
spec[#spec + 1] = {
"epwalsh/obsidian.nvim",
lazy = true,
ft = "markdown",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("obsidian").setup({
workspace = vim.g.obsidian_workspace,
})
end,
}
end

return spec

0 comments on commit f1b22dd

Please sign in to comment.