neorg icon indicating copy to clipboard operation
neorg copied to clipboard

Can't open file link

Open yassinebenarbia opened this issue 1 year ago • 2 comments

Prerequisites

  • [X] I am using the latest stable release of Neovim
  • [X] I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0

Neorg setup

{
  load = {
    ["core.keybinds"] = {
      config = {
        hook = function(keybinds)
        end,
      }
    },
    ["core.defaults"] = {},
    ["core.concealer"] = {},
    ["core.dirman"] = {
      config = {
        workspaces = {
          notes = "~/Notes",
        },
      },
    },
  },

Actual behavior

After I've updated my plugins by today's date (2024-07-30) (Including Neorg), I couldn't open my linked files in the index.norg head

Expected behavior

Open the the file if exist, else crates it and open it

Steps to reproduce

I can't give exact steps to reproduce, but I can provide some information about the system OS: NixOS (unstable) Neovim version: 0.10.0 LuaJIT version: 2.1.1713773202 Neorg versoin: updated using the Lazy package manager from the main branch to the e5e797e commit

Potentially conflicting plugins

IDK, my best guess is that the default mapping of the <CR> somehow got overwritten by some other keybind (which is not correct since I don't map the <CR> key to anything)

Other information

This is the output of :checkhealth neorg

neorg: require("neorg.health").check()

Neorg Configuration ~
- Checking `load` table...
- OK Module declaration for `core.defaults` is well-formed
- OK Module declaration for `core.keybinds` is well-formed
- OK Module declaration for `core.dirman` is well-formed
- OK Module declaration for `core.concealer` is well-formed
- OK Default configuration for logger provided, Neorg will not output debug info.

Neorg Dependencies ~
- OK `luarocks` is installed.

Neorg Keybinds ~
- Neorg is configured to use keybind preset `neorg`
- WARNING Key `<CR>` conflicts with a key bound by the user. Neorg will not bind this key.
  - ADVICE:
    - consider mapping `<Plug>(neorg.esupports.hop.hop-link)` to a different key than the one bound by Neorg.

Help

if needed

yassinebenarbia avatar Jul 30 '24 00:07 yassinebenarbia

it tells you in the healtcheck that the <cr> mapping isnt' created because it's already mapped somewhere so search in your config (or your plugins) for <cr> and remove that mapping or just map something to <Plug>(neorg.esupports.hop.hop-link) yourself (can also map cr manually)

max397574 avatar Jul 30 '24 05:07 max397574

It was mapped, to <CR>, I really don't understand why mapping <CR> to <CR> brakes it tho, also removing that keybind does not solve the issue, it now opens the explorer on a horizontal split, while also displaying the same warning when I :checkhealth neorg Also:

  • <M-CR> keybind opens the file on a vertical split as intended.
  • After I checked,I have no other keybind mapped to <CR>.

Edit:

  • Forgot to mention that mapping the <CR> key to <Plug>(neorg.esupports.hop.hop-link) conserve the same behavior of opening the explorer in a horizontal split.
  • The keybind existed when opening a file link was possible (before the update)

yassinebenarbia avatar Jul 30 '24 15:07 yassinebenarbia

Try checking the <C-M> keybinding. https://neovim.io/doc/user/motion.html#up-down-motions

+  		or					+  
CTRL-M		or					CTRL-M <CR>
<CR>			[count] lines downward, on the first non-blank
			character linewise.

I have this problem today and I found that it is caused by a keymap of <c-m> unrelated to neorg. Remove that keymap and the neorg file link works again.

amalgame21 avatar Nov 03 '24 22:11 amalgame21

What link format are you using? I was having this issue but found {:/path/to/file.norg:} worked.

Jellie06 avatar Nov 26 '24 17:11 Jellie06

Can confirm - I was having the same issue, <CR> was mapped correctly but I had a <C-M> mapping and as soon as I removed it the links open correctly. Thank you @amalgame21 !

christiankopac avatar Dec 29 '24 13:12 christiankopac

Try checking the <C-M> keybinding. https://neovim.io/doc/user/motion.html#up-down-motions

+  		or					+  
CTRL-M		or					CTRL-M <CR>
<CR>			[count] lines downward, on the first non-blank
			character linewise.

I have this problem today and I found that it is caused by a keymap of <c-m> unrelated to neorg. Remove that keymap and the neorg file link works again.

Can confirm that this was the issue, I had a completely unrelated keybind of <c-m> (also for some reason, mapping <CR> to <CR> brakes it :\ ) removed that, and things got back to work! Thanks allot!

yassinebenarbia avatar Dec 29 '24 21:12 yassinebenarbia