Code Monkey home page Code Monkey logo

Comments (4)

foldedstar avatar foldedstar commented on May 20, 2024

I've done a little debugging and I've determined that links in the form name are correctly renamed.
It is only when a file is created via a [[name]] link insertion, and then that file is subsequently renamed (wr) that those [[name]] links are not reflected.

Is this intended functionality (i.e. is renaming of [[ ]] links unsupported), or is this a bug?

from vimwiki.

tinmarino avatar tinmarino commented on May 20, 2024

Markdown does not support the double "[[" links for now. This is a pending tasks, sorry for the inconvenience.

Meanwhile, you can perform custom changes in the file vars.vim to imitate the default (wiki) syntax.

Have a look at #892 (Pressing enter to create a [[double bracket]]).

There is another issue to support double square bracket in markdown but I lost track.

I leave this ticket open as this is a desired feature (the future change should support renaming as well).

Note that it is hard to support both type of links, which is why I have been procrastinating this feature for 2 years now

from vimwiki.

ludenticus avatar ludenticus commented on May 20, 2024

Wanted to open an issue, but found out @foldedstar already pointed this out... I guess it makes much sense: either to stick with vimwiki syntax, or stick with []() format in MD.

from vimwiki.

pbhemphill avatar pbhemphill commented on May 20, 2024

I don't believe this is related to the type of link used. I have noticed that, in general, :VimwikiRenameFile properly renames relative links, but fails to update absolute links (that is, /-initial links relative to the wiki root, not filesystem-absolute paths). This appears to be the case for both the default and markdown syntaxes.

I have tested this on a clean vimwiki directory with a minimal vimrc. A minimal example follows:

Relevant part of vimrc:

let wiki = {}
let wiki.path = '~/test_vimwiki'
let wiki.syntax = 'default'
let wiki.index = 'home'
let wiki.ext = '.wiki'
let g:vimwiki_list = [wiki]

home.wiki contains:

Test page link: [[page_name]]

Test absolute page link: [[/page_name]]

page_name.wiki exists and is navigable from both links in home.wiki.

When I call :VimwikiRenameFile while in page_name.wiki and rename the file to new_page_name, home.wiki then contains:

Test page link: [[new_page_name]]

Test absolute page link: [[/page_name]]

Expected behavior is that both links would be updated, so home.wiki should contain:

Test page link: [[new_page_name]]

Test absolute page link: [[/new_page_name]]

A similar set of steps confirms that this happens with markdown syntax and markdown-style []() links as well.

This becomes an issue when I link to a top-level file from a diary file, which requires an absolute path - if I later rename that file, the link in the diary entry breaks.

My :VimwikiShowVersion:

Version: 2024.01.24
Os: Mac
Vim: 901
Branch: dev
Revision: 69318e7
Date: 2024-03-16 14:23:28 -0300

from vimwiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.