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

Feature: Version of MkdnFollowLink that does not create links #214

Closed
Jaehaks opened this issue Apr 22, 2024 · 2 comments
Closed

Feature: Version of MkdnFollowLink that does not create links #214

Jaehaks opened this issue Apr 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Jaehaks
Copy link

Jaehaks commented Apr 22, 2024

Thank you for your efforts,

How can I disable MkdnEnter to disable MkdnCreateLink?
My config is like this

mappings = {
  MkdnEnter = false,-- 'n, v' : make link / 'i' : insert new list item
  MkdnTab = false,-- jump to next cell / indent list item (use autolist.nvim)
  MkdnSTab = false, -- (use autolist.nvim)
  MkdnNextLink = {'n', '<Tab>'},
  MkdnPrevLink = {'n', '<S-Tab>'},
  MkdnNextHeading = {'n', ']]'},
  MkdnPrevHeading = {'n', '[['},
  MkdnGoBack = false, -- open the historically last buffer
  MkdnGoForward = false,
  MkdnCreateLink = false, -- see MkdnEnter
  MkdnCreateLinkFromClipboard = {{'n', 'v'}, '<leader>p'}, -- see MkdnEnter
  MkdnFollowLink = {'n', '<CR>'}, -- see MkdnEnter
  MkdnDestroyLink = {'n', '<M-CR>'},
  MkdnTagSpan = {'v', '<M-CR>'},
  MkdnMoveSource = {'n', '<F2>'},
  MkdnYankAnchorLink = {'n', 'yaa'},
  MkdnYankFileAnchorLink = {'n', 'yfa'},
  MkdnIncreaseHeading = {'n', '+'},
  MkdnDecreaseHeading = {'n', '-'},
  MkdnToggleToDo = {{'n', 'v'}, '<C-Space>'},
  MkdnNewListItem = false,-- insert list item automatically (use autolist.nvim)
  MkdnNewListItemBelowInsert = false, -- (use autolist.nvim)
  MkdnNewListItemAboveInsert = false, -- (use autolist.nvim)
  MkdnExtendList = false,
  MkdnUpdateNumbering = false, -- (use autolist.nvim)
  MkdnTableNextCell = {'i', '<Tab>'},
  MkdnTablePrevCell = {'i', '<S-Tab>'},
  MkdnTableNextRow = false,
  MkdnTablePrevRow = {'i', '<M-CR>'},
  MkdnTableNewRowBelow = {'n', '<leader>ir'},
  MkdnTableNewRowAbove = {'n', '<leader>iR'},
  MkdnTableNewColAfter = {'n', '<leader>ic'},
  MkdnTableNewColBefore = {'n', '<leader>iC'},
  MkdnFoldSection = {'n', '<leader>f'},
  MkdnUnfoldSection = {'n', '<leader>F'}
}

I set MkdnEnter to false and MkdnCreateLink to false. because I just want to use <CR> to follow links
but Although above configuration, New link is created by typing `' in normal mode.
In visual mode, the creating link is disabled

@jakewvincent jakewvincent added the bug Something isn't working label Jun 3, 2024
@jakewvincent jakewvincent self-assigned this Jun 3, 2024
@jakewvincent jakewvincent added enhancement New feature or request and removed bug Something isn't working labels Jun 3, 2024
@jakewvincent jakewvincent changed the title I cannot disable MkdnEnter Feature: Version of MkdnFollowLink that does not create links Jun 3, 2024
@jakewvincent
Copy link
Owner

Hi @Jaehaks, I'm considering this an enhancement request since MkdnFollowLink is currently set up to follow a link or otherwise create one if the cursor isn't on a link already (see description here). I will get back to you soon with a solution.

@jakewvincent
Copy link
Owner

@Jaehaks, there's a new configuration option under links now that will allow you to disable link creation in the case that there is no link to follow under the cursor. In your config under links, set create_on_follow_failure to false, e.g.:

require('mkdnflow').setup({
    -- ...
    links = {
        create_on_follow_failure = false
    }
    -- ...
})

This should get you the behavior you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants