epwalsh / epwalsh/obsidian.nvim

conceallevel warning with conceallevel=2

Open
#617 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Lua
Stars
6.2k
Forks
250
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Describe the bug

Hi,

I get warnings for the conceallevel even though it's set at 2:
"Obsidian additional syntax features require 'conceallevel' to be set to 1 or 2, but you have 'conceallevel' set to '3'. "

my way of reproducing is restart nvim and open an md file `:vsp my_file.md`. And I always check before with `:set conceallevel?` to see if maybe there is something that changes the conceallevel but I don't see it. I believe there is a command to check if a plugin or a line code in the config that changes it but I don't remember it.

Thanks

### Config

```
require('obsidian').setup {
workspaces = {
{
name = 'work',
path = '~/Documents/Brain',
},
{
name = 'no-vault',
path = function()
-- alternatively use the CWD:
-- return assert(vim.fn.getcwd())
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
end,
overrides = {
notes_subdir = vim.NIL, -- have to use 'vim.NIL' instead of 'nil'
new_notes_location = 'current_dir',
templates = {
folder = vim.NIL,
},
disable_frontmatter = true,
},
},
},
daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
folder = 'dailies',
-- Optional, if you want to change the date format for the ID of daily notes.
date_format = '%Y-%m-%d',
-- Optional, if you want to change the date format of the default alias of daily notes.
alias_format = '%B %-d, %Y',
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
template = nil,
},
-- Optional, customize how note IDs are generated given an optional title.
---@param title string|?
---@return string
note_id_func = function(title)
-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
-- In this case a note with the title 'My new note' will be given an ID that looks
-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
local prefix = ''
if title ~= nil then
-- If title is given, transform it into valid file name.
prefix = title:gsub(' ', '-'):gsub('[^A-Za-z0-9-]', ''):lower()
else
-- If title is nil, just add 4 random uppercase letters to the suffix.
for _ = 1, 4 do
prefix = prefix .. string.char(math.random(65, 90))
end
end
return prefix .. '-' .. tostring(os.time())
end,
-- URL it will be ignored but you can customize this behavior here.
---@param url string
follow_url_func = function(url)
-- Open the URL in the default web browser.
vim.fn.jobstart { 'xdg-open', url } -- linux
end,
mappings = {
['oy'] = {
action = function()
return vim.cmd 'ObsidianYesterday'
end,
opts = { buffer = true },
},
['ot'] = {
action = function()
return vim.cmd 'ObsidianTomorrow'
end,
opts = { buffer = true },
},
['oo'] = {
action = function()
return vim.cmd 'ObsidianToday'
end,
opts = { buffer = true },
},
[''] = {
action = function()
return vim.cmd 'ObsidianQuickSwitch'
end,
opts = { buffer = true },
},
},
}

```

### Environment

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
Obsidian.nvim v3.7.6 (d70f3289399c25153b7f503b838afbf981124a37)
Status:
• buffer directory: nil
• working directory: /home/isos9
Workspaces:
✓ active workspace: Workspace(name='no-vault', path='/home/isos9', root='/home/isos9')
✗ inactive workspace: Workspace(name='work', path='/home/isos9/Documents/Brain', root='/home/isos9/Documents/Brain')
Dependencies:
✓ plenary.nvim: 253d34830709d690f013daf2853a9d21ad7accab
✓ nvim-cmp: d3a2833c118843859c667f64b6169e22bffe13d0
✓ telescope.nvim: 4522d7e3ea75ffddabdc39957168a8a7060b5df0
Integrations:
✓ picker: TelescopePicker()
✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
all sources:
• luasnip
• nvim_lsp
• path
• nvim_lua
• buffer
Tools:
✓ rg: ripgrep 14.1.0
Environment:
• operating system: Linux
Config:
• notes_subdir: nil

Contributor guide

Open the contributing guide

Research direction

Reproduce the warning after restarting Neovim, opening an .md file with `:vsp my_file.md`, and checking `:set conceallevel?`. Start from the Obsidian.nvim setup and the conceallevel warning path; determine why the warning reports 3 when the user reports 2, then verify the warning is absent when the setting is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.