-
Notifications
You must be signed in to change notification settings - Fork 69
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 Request] Change link title based on note content #280
Comments
Have you tried |
I must have been blind! I think I've looked into a wrong place. Also I had my own basic implementation of it which worked so ddidn't really look further. But Yes this works the as expected though on single link. What I'm insterested in is a scaled version such that we visually select portion of the text and applying |
Let's focus on wiki.vim. I assume with "are often created", you mean e.g. when you do
Notice that wiki.vim also provides the text objects
@kosciak is right to mention
I'm generally positive to adjust and further develop wiki.vim with new and improved features as long as I can see how it would be useful to me and/or the community.
This should not be too hard. To be more precise, you want a visual version of So, if I implemented the feature according to the following suggested documentation, you would have more or less what you want?
|
I have lots of notes created before use of I'm compeltely agree on all other points.
Yes exactly, that's perfectly targets what I wanted. |
There, I've merged #306 - I believe the feature should work as expected now. |
When using wiki.vim or even plain Vim, links to notes are often created with the filename of the note as the title, such as
[filename](filename.md)
. However, this can be suboptimal if the filename does not accurately reflect the content of the note. While I can useci]
to change the link title manually, it can be error-prone and with some hassle. To streamline this process, a keymap can call a function on current link and checks its content (e.g., by looking for a header), and replaces the link title with a more appropriate one.I previously (before using any wiki) have written a basic function -- based on my limitd experience with vim script -- that did this under
,ct
map.Minimal working example
This function works in a rudimentary way, but these days I'm enjoying
wiki.vim
and just wonder if possible to add such functionality with more robust support within wiki.vim instead. For example, if I could visually select all link in current note and press,ct
to update all titles in the selection.The text was updated successfully, but these errors were encountered: