You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is due to a recent upgrade of Neovim to v0.11.
When this plugin is loaded, nvim will report an error like this:
It seems it is caused by a call of a vim function.
Config
Not related. But provided below:
require("obsidian").setup({
workspaces = {
{
name = "xVimObsidian",
path = getWorkspacePath(),
},
},
-- Optional, if you keep notes in a specific subdirectory of your vault.
notes_subdir = "_quick.notes",
-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
completion = {
-- Set to false to disable completion.
nvim_cmp = true,
-- Trigger completion at 2 chars.
min_chars = 2,
},
-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
-- way then set 'mappings = {}'.
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
["gf"] = {
action = function()
return require("obsidian").util.gf_passthrough()
end,
opts = { noremap = false, expr = true, buffer = true },
},
-- Toggle check-boxes.
["<leader>ch"] = {
action = function()
return require("obsidian").util.toggle_checkbox()
end,
opts = { buffer = true },
},
-- -- Smart action depending on context, either follow link or toggle checkbox.
["<cr>"] = {
action = function()
return require("obsidian").util.smart_action()
end,
opts = { buffer = true },
},
},
-- Where to put new notes. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "notes_subdir",
-- 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 suffix = ""
if title ~= nil then
-- If title is given, transform it into valid file name.
suffix = 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
suffix = suffix .. string.char(math.random(65, 90))
end
end
return tostring(os.date("%Y-%m-%d-%H%M")) .. "_" .. suffix
end,
-- Optional, customize how note file names are generated given the ID, target directory, and title.
---@param spec { id: string, dir: obsidian.Path, title: string|? }
---@return string|obsidian.Path The full path to the new note.
note_path_func = function(spec)
-- This is equivalent to the default behavior.
local path = spec.dir / tostring(spec.id)
return path:with_suffix(".md")
end,
-- Optional, customize how wiki links are formatted. You can set this to one of:
-- * "use_alias_only", e.g. '[[Foo Bar]]'
-- * "prepend_note_id", e.g. '[[foo-bar|Foo Bar]]'
-- * "prepend_note_path", e.g. '[[foo-bar.md|Foo Bar]]'
-- * "use_path_only", e.g. '[[foo-bar.md]]'
-- Or you can set it to a function that takes a table of options and returns a string, like this:
wiki_link_func = function(opts)
return require("obsidian.util").wiki_link_id_prefix(opts)
end,
-- Optional, customize how markdown links are formatted.
markdown_link_func = function(opts)
return require("obsidian.util").markdown_link(opts)
end,
-- Either 'wiki' or 'markdown'.
preferred_link_style = "wiki",
-- Optional, customize the default name or prefix when pasting images via `:ObsidianPasteImg`.
---@return string
image_name_func = function()
-- Prefix image names with timestamp.
return string.format("%s-", os.time())
end,
-- Specify how to handle attachments.
attachments = {
-- The default folder to place images in via `:ObsidianPasteImg`.
-- If this is a relative path it will be interpreted as relative to the vault root.
-- You can always override this per image by passing a full path to the command instead of just a filename.
img_folder = "assets/imgs", -- This is the default
-- A function that determines the text to insert in the note when pasting an image.
-- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file.
-- This is the default implementation.
---@param client obsidian.Client
---@param path obsidian.Path the absolute path to the image file
---@return string
img_text_func = function(client, path)
path = client:vault_relative_path(path) or path
return string.format("![%s](%s)", path.name, path)
end,
},
})
Environment
NVIM v0.11.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Run "nvim -V1 -v" for more info
The text was updated successfully, but these errors were encountered:
hi @epwalsh, thanks for the great plugin. The issue still persist for me (nvim 0.11.0-dev). Not sure if this PR has been included in the 3.7.12 release yet.
馃悰 Describe the bug
This bug is due to a recent upgrade of
Neovim
tov0.11
.When this plugin is loaded,
![image](https://private-user-images.githubusercontent.com/1921878/333174344-d29063b2-dfe6-4ef6-b303-15d3008485c3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MjA1MDksIm5iZiI6MTcxOTkyMDIwOSwicGF0aCI6Ii8xOTIxODc4LzMzMzE3NDM0NC1kMjkwNjNiMi1kZmU2LTRlZjYtYjMwMy0xNWQzMDA4NDg1YzMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDJUMTEzNjQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTMwYzNhNGU2YjExOTdmODE5MmRjMGFjOTU1NTZiNWUzNTgzNzIzYjMzNDg5MWUzYTQwNTdlYTRmNmJhZTJjZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.YupIFRP4eLRAEo10fhApzkhT9HE2-flFUuBrjDshqvc)
nvim
will report an error like this:It seems it is caused by a call of a vim function.
Config
Not related. But provided below:
Environment
The text was updated successfully, but these errors were encountered: