Closed RaraCool closed 9 months ago
Hey @RaraCool, sorry you're having trouble getting set up. I don't have access to a Windows machine so I can't help debugging directly, but you might want to try specifying the path in unix format, and if that fails you could use the Path
type from plenary.nvim. Something like:
local Path = require "plenary.path"
...
path = Path:new("C:") / "path" / "to" / "vault",
I'm also on Windows, but I write the path in the shell configuration file and read it with vim.fn.expand
.
$PROFILE
$env:win_documents = Join-Path $env:USERPROFILE -ChildPath "Documents"
$env:obsidian_vault_path Join-Path $env:win_documents -ChildPath "Obsidian/mimikun"
$obsidian_vault_path = $env:obsidian_vault_path
local vault_path = vim.fn.expand("$obsidian_vault_path")
return {
"epwalsh/obsidian.nvim",
version = "*",
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
workspaces = {
{
name = "personal",
path = vault_path,
},
},
},
}
Recently we've made the way we handle paths much more robust across different operating systems. If this is still an issue I'll reopen.
🐛 Describe the bug
I am using Neovim on Windows and would like to use this plugin, however I cannot get the workspace option to point to my vault correctly. Because backslash is the escape character in Lua, I am using double backslashes, but this is still not working.
When I use
:ObsidianOpen
, I get the following message:Current buffer 'C:\Path\To\Vault\Note.md' does not appear to be inside the vault.
Versions
nvim --version
lazy-lock.json