jakewvincent / mkdnflow.nvim

Fluent navigation and management of markdown notebooks
GNU General Public License v3.0
654 stars 37 forks source link

Question: Change `MkdnFollowLink` to not create links #186

Closed aorith closed 1 month ago

aorith commented 6 months ago

Currently I do not see how to implement this behaviour:

  1. Only create links in visual mode
  2. Only follow links in normal mode
      mappings = {
        MkdnEnter = { "v", "<cr>" },
        MkdnFollowLink = { "n", "<cr>" },
     }

With the above configuration (or with the default configuration) if I have the following markdown text:

- List item 1

And the cursor is on the first column (- char) and press ENTER, a link is created. If I continue to press ENTER nested links are created:

First enter:

- [List](2023-12-30_list.md) item 1

Second:

- [[List](2023-12-30_list.md)](2023-12-30_list.md) item 1

Would you consider to have a command/function that only follows the nearest link in the current line or does nothing if there is not link?

jakewvincent commented 1 month ago

Hi @aorith, sorry for the delay. There's now a config option that affects what happens if there is no link under the cursor to follow. Please see my final comment on Issue 214.