Skip to content

Commit

Permalink
fix(obsidian): disable ui
Browse files Browse the repository at this point in the history
conflict obsidian and render-markdown
  • Loading branch information
misumisumi committed Aug 24, 2024
1 parent ace5aca commit c8f0381
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
19 changes: 3 additions & 16 deletions lua/user/configs/tool/obsidian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ M.enabled = function()
return vim.fn.isdirectory(vim.fn.expand("~/Documents/memopad")) == 1
end

M.init = function()
vim.api.nvim_create_autocmd("BufRead", {
pattern = { "*.md" },
callback = function()
local root_patterns = { ".obsidian" }
if vim.fs.find(root_patterns, { upward = true })[1] ~= nil then
vim.opt_local.concealcursor = ""
vim.opt_local.conceallevel = 1
end
end,
})
end

M.setup = {
mappings = {
["<leader><leader>p"] = {
Expand Down Expand Up @@ -83,6 +70,9 @@ M.setup = {
attachments = {
img_folder = "assets",
},
ui = {
enable = false,
},
note_id_func = function(title) -- luacheck: ignore
-- just use unix timestamp for note id
return tostring(os.time())
Expand All @@ -92,7 +82,6 @@ M.setup = {
require("obsidian-kensaku")(client)
-- NOTE: https://github.com/epwalsh/obsidian.nvim/issues/467
vim.api.nvim_create_user_command("ObsidianCreate", function()
vim.opt.conceallevel = 1
-- local client = require("obsidian").get_client()
local utils = require("obsidian.util")
-- prevent Obsidian.nvim from injecting it's own frontmatter table
Expand All @@ -111,7 +100,6 @@ M.setup = {
client:open_note(note, {
sync = true,
callback = function(bufnr)
vim.opt_local.conceallevel = 1
buf = bufnr
end,
})
Expand All @@ -129,7 +117,6 @@ M.setup = {
vim.api.nvim_buf_set_lines(buf, 0, 2, false, {})
end,
})
vim.opt.conceallevel = 0
end, {})
vim.api.nvim_create_user_command("ObsidianSearchAsset", function()
local picker = client:picker()
Expand Down
2 changes: 1 addition & 1 deletion lua/user/plugins/lang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lang["dhruvasagar/vim-table-mode"] = {
}
lang["kiyoon/jupynium.nvim"] = {
lazy = true,
ft = "python",
event = "BufEnter *.ju.*",
build = function()
if not vim.fn.filereadable("/etc/NIXOS") then
return "pip install --user ."
Expand Down

0 comments on commit c8f0381

Please sign in to comment.