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

:Neorg mode traverse-link<cr> and then It can not jump to link file when I press <cr> under a file link #1465

Open
2 tasks done
peter-lyr opened this issue Jun 13, 2024 · 2 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@peter-lyr
Copy link

Prerequisites

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

Neovim Version

NVIM v0.10.0

Neorg setup

require 'neorg'.setup {
load = {
['core.defaults'] = {},
['core.concealer'] = {},
['core.esupports.metagen'] = {
config = {
update_date = false,
type = 'empty',
author = 'peter-lyr',
timezone = 'implicit-local',
},
},
['core.export'] = {},
['core.export.markdown'] = {
config = {
extensions = 'all',
},
},
['core.ui'] = {},
['core.ui.calendar'] = {}, -- 解决中文乱码问题需要将Windows display language改为英文(美国)
['core.tempus'] = {},
['core.dirman'] = {
config = {
workspaces = {
work = DepeiRepos .. '\work',
life = DepeiRepos .. '\life',
study = DepeiRepos .. '\study',
},
default_workspace = 'work',
},
},
['core.integrations.telescope'] = {},
},
}

Actual behavior

:Neorg mode traverse-link<cr> and then It can jump to link file when I press <cr> under a file link

Expected behavior

:Neorg mode traverse-link<cr> and then It can not jump to link file when I press <cr> under a file link

Steps to reproduce

:Neorg mode traverse-link<cr> and then It can not jump to link file when I press <cr> under a file link

Potentially conflicting plugins

No response

Other information

No response

Help

None

Implementation help

No response

@peter-lyr peter-lyr added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jun 13, 2024
@peter-lyr
Copy link
Author

I have to :Neorg mode norg<cr>.
I don't want it.

@sahinf
Copy link
Contributor

sahinf commented Jun 15, 2024

I believe the issue stems from a lack of mapping the keybind for traverse-link mode. Enter key gets mapped for mode norg here:

keybinds.map_event_to_mode("norg", {

{ "<CR>", "core.esupports.hop.hop-link", opts = { desc = "[neorg] Jump to Link" } },

A fix could be to duplicate the mapping into mode traverse-link

keybinds.map_event_to_mode("traverse-link", {

-- Hop to the destination of the link under the cursor
                    { "<CR>", "core.esupports.hop.hop-link", opts = { desc = "[neorg] Jump to Link" } },
                    { "gd", "core.esupports.hop.hop-link", opts = { desc = "[neorg] Jump to Link" } },
                    { "gf", "core.esupports.hop.hop-link", opts = { desc = "[neorg] Jump to Link" } },
                    { "gF", "core.esupports.hop.hop-link", opts = { desc = "[neorg] Jump to Link" } },

                    -- Same as `<CR>`, except opens the destination in a vertical split
                    {
                        "<M-CR>",
                        "core.esupports.hop.hop-link",
                        "vsplit",
                        opts = { desc = "[neorg] Jump to Link (Vertical Split)" },
                    },

But it might make more sense to refactor keybind mapping to specify a list of modes per keymap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

2 participants