Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian.nvim isn't able to open vaults with the :ObsidianOpen command #668

Open
1 task done
PixeKnight opened this issue Feb 27, 2025 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@PixeKnight
Copy link

PixeKnight commented Feb 27, 2025

⚠️ Please verify that this bug has NOT been reported before.

  • I checked all existing issues and didn't find a similar issue

Description

Trying :ObsidianOpen in neovim doesn't open the vaults like it should

<leader>o shortcut also doesn't work which I assume to be a related issue

There are no issues accessing the files manually however, all the obsidian.nvim shortcuts like marking the checkbox work fine.

👟 Reproduction steps

Nvf config, using the homeManager module, using flakes, and stable-24.11 nixpkg branch: (Note: I changed the username to user)

{pkgs, ...}: {
  programs.nvf = {
    enable = true;
    # your settings need to go into the settings attribute set
    # most settings are documented in the appendix
    settings = {
      vim = {
        theme = {
          enable = true;
          name = "catppuccin";
          style = "frappe";
        };
        viAlias = true;
        vimAlias = true;
        options = {
          expandtab = true;
          tabstop = 2;
          softtabstop = 2;
          shiftwidth = 2;
          wrap = false;
          conceallevel = 2;
        };
        binds.whichKey.enable = true;
        statusline.lualine.enable = true;
        telescope.enable = true;
        filetree.nvimTree = {
          enable = true;
          mappings.toggle = "<leader>tt";
          openOnSetup = false;
          setupOpts.view.side = "right";
        };
        syntaxHighlighting = true;
        minimap.codewindow.enable = true;
        dashboard.alpha.enable = true;
        autocomplete.nvim-cmp.enable = true;
        tabline.nvimBufferline.enable = true;
        notes = {
          todo-comments.enable = true;
          obsidian = {
            enable = true;
            setupOpts = {
              completion.nvim-cmp = true;
              workspaces = [
                {
                  name = "Notes";
                  path = "/home/user/Documents/Vaults/Notes";
                  # strict = true;
                }
              ];
            };
          };
        };
        comments.comment-nvim.enable = true;
        autopairs.nvim-autopairs.enable = true;
        snippets.luasnip.enable = true;
        treesitter = {
          enable = true;
          context.enable = true;
          fold = true;
          autotagHtml.enable = true;
        };
        lsp.enable = true;
        ui.breadcrumbs.enable = true;
        ui.breadcrumbs.navbuddy.enable = true;
        ui.modes-nvim.enable = true;
        ui.modes-nvim.setupOpts = {
          line_opacity.visual = 0.15;
          setCursorline = true;
        };
        visuals = {
          indent-blankline.enable = true;
          fidget-nvim.enable = true;
          highlight-undo.enable = true;
          nvim-cursorline.enable = true;
          nvim-cursorline.setupOpts = {
            cursorword.enable = true;
            cursorline.enable = false;
          };
          nvim-scrollbar.enable = true;
          nvim-web-devicons.enable = true;
          rainbow-delimiters.enable = true;
        };
        utility = {
          multicursors.enable = true;
          # hydra.enable = true;
          # images.image-nvim.enable = true;
        };
        languages = {
          enableLSP = true;
          enableDAP = true;
          enableFormat = true;
          enableTreesitter = true;
          nix.enable = true;
          bash.enable = true;
          rust.enable = true;
          clang.enable = true;
          markdown = {
            enable = true;
            extensions.render-markdown-nvim.enable = true;
          };
        };
        # formatter.conform-nvim = {
        #   enable = true;
        #   setupOpts.formatters = {
        #   };
        # };
      };
    };
  };
  home.packages = with pkgs; [
    wl-clipboard
    xclip
  ];
}

👀 Expected behavior

Neovim opens the Notes vault

😓 Actual Behavior

:ObsidianOpen returns this error message:

Error executing Lua callback: ...dir/pack/mnw/start/obsidian-nvim/lua/obsidian/client.lua:249: failed to resolve '/nix/store/bbk0zj9xyilgbf3cwz8gvml16p525siw-neovim-unwrapped-0.10.2/share/nv
im/runtime/doc/options.txt' relative to vault root '/home/user/Documents/Vaults/Notes'
stack traceback:
[C]: in function 'error'
...dir/pack/mnw/start/obsidian-nvim/lua/obsidian/client.lua:249: in function 'vault_relative_path'
...k/mnw/start/obsidian-nvim/lua/obsidian/commands/open.lua:99: in function 'func'
...k/mnw/start/obsidian-nvim/lua/obsidian/commands/init.lua:70: in function <...k/mnw/start/obsidian-nvim/lua/obsidian/commands/init.lua:69>

<leader>o shortcut returns the following error message:

E21: Cannot make changes, 'modifiable' is off

💻 Metadata

❯ nix-shell -p nix-info --run "nix-info -m"

📝 Relevant log output

- system: `"x86_64-linux"`
 - host os: `Linux 6.6.79, NixOS, 24.11 (Vicuna), 24.11.20250223.04ef94c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - nixpkgs: `/nix/store/qxm3knblqapg1463b1pwjn7isla5v164-source`
@PixeKnight PixeKnight added the bug Something isn't working label Feb 27, 2025
@PixeKnight
Copy link
Author

Ok, yeah the leader o shortcut's error message is completely unrelated, this was because the shortcut was being ignored and tried to add an extra line in the dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant