-
Notifications
You must be signed in to change notification settings - Fork 621
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
Pressing enter to create a [[double bracket]] #892
Comments
Hi, I just want to chime in and say that I would also very much prefer the double brackets in Markdown files. If Markdown style links are the default for the Markdown syntax, would you consider adding something like g:vimwiki_link_format, or an option to g:vimwiki_list? |
We just released v2.5 a few days ago, so you likely have upgraded vimwiki without realizing when moving to the new setup. @ranebrown @tinmarino: Do you know if there was a change in 2.5 that affects this? @sharingtom: Do you also have a regression (meaning previously double brackets in Markdown worked) or is this "just" a feature request? @santiyounger: Can you try downgrading to 2.4 and check if it works then again?
and |
No. I've always got The stack trace for someone wanting to create an PR for an option: Where you can see that the issue author would like a link format that the dev have called More:
|
It’s a feature request from my side. A few days ago I found Obsidian, which has a lot of the functionality of Vimwiki – minus Vim – but uses Markdown and square bracket links. It would be great to be able to easily collaborate on wikis with non-Vim users. I absolutely love Vimwiki, but convincing most non-technical people to learn Vim for wiki collaboration is just not an option. While square brackets can be added manually in Vimwiki to create the links, the Enter link formatting would be a quality of life improvement for me. I’m not at a skill level where I can make a PR to make it work. Not yet at least. |
Hey @Nudin, thank you so much for your kind reply. I tried installing v2.4.1, unfortunately it is still showing this format text Since I completely wiped my ubuntu set up into my new manjaro KDE I have no way of finding what was the exact version I was on. I fully agree with @sharingtom with this being a really essential function. More thank anything I want to truly thank you for making such an amazing tool, and for using your valuable time to help those of us who use it everyday, you guys are amazing. |
@tinmarino Thanks a lot for your reply, unfortunately my skill level didn't allow me to fully understand your suggestions. I can comfortably modify things in my .vimrc file. But things such as creating a PR I don't fully understand what that means. If you can put it in simple terms that would be much appreciated, I'm happy with a workaround solution if needed. |
I know that the question wasn't directed at me, but PR is short for pull request. If you modify the Vimwiki codebase (not just the .vimrc) to add the double square bracket functionality to the Markdown syntax, a pull request is basically how to ask the maintainers of Vimwiki here on GitHub to add the change to the main codebase and thus make it available to everyone. I would also like to thank everyone who is a part of making Vimwiki. For all its simplicity (in use) it is wonderfully powerful. |
@sharingtom Thanks, great explanation I appreciate it! I'll keep looking for solutions to this situation if I find one I'll post it here! Thanks guys |
…(Issue vimwiki#892) Main change: Create function: normalize_syntax_settings(syntax) Problem: Some user prefer [[]] links more than [](). As vimwiki know both of them, they should be able to choose without regex mastery and with tests Solution: let g:vimwiki_syntax_variables.markdown.Link1 = vimwiki#vars#get_global('WikiLinkTemplate1')
Read the commit message of the commit referencing this issue. (The last one: they often break tests and I commit amend in my repo) Adding in Fixed: Workaround or better say ... undocumented solution :
This may change and get documented. Meanwhile, follow the changes in test/link_creation.vader or grep the issue number in the repo Related: #894 |
…(Issue vimwiki#892) Main change: Create function: normalize_syntax_settings(syntax) Problem: Some user prefer [[]] links more than [](). As vimwiki know both of them, they should be able to choose without regex mastery and with tests Solution: let g:vimwiki_syntax_variables.markdown.Link1 = vimwiki#vars#get_global('WikiLinkTemplate1')
I observed the same change in behaviour.
changed the link creation back to |
Yeah that does fix it but now everything else is broke in regards to markdown formatting. 😄 |
After installing the
This is the relevant line in my let g:vimwiki_syntax_list['markdown']['Link1'] = vimwiki#vars#get_global('WikiLinkTemplate1') I'm not super familiar with vimscript, so I may not be instantiating the dict correctly? I modeled the configuration off of the tests here: vimwiki/test/link_creation.vader Lines 9 to 32 in a687801
And in the new docs: Lines 2850 to 2863 in a687801
Thank you so much for your time and assistance! |
On the :let g:vimwiki_syntaxlocal_vars['markdown']['Link1'] = g:vimwiki_syntaxlocal_vars['default']['Link1'] Now when I have the following markdown file: hello, world and I press I see this: hello, [[world]] |
I knew if I watched this thread long enough I'd find the answer. Thanks @Thomascountz! I've added the relevant config changes to my dotfiles. Essentially you just need to defer setting the variable until after the vimwiki plugin has loaded. I've done this via |
@ericboehs that autocmd still throws an error for me because the dict is not initialised. Perhaps a custom vimwiki autocmd would be useful for this (though at that point is it just easier to configure it in vimwiki_list?) |
@alexcardell I'm not sure I'm understanding your problem but I'm guessing you're on the |
Ah no, my apologies, I was on dev but the issue was with my autocmds; Just the quirks of my setup, I should have tried it with a clean vim before commenting, it works now! Edit: I did a little more tinkering and noticed that this solution doesn't work if you defer loading vimwiki using Vimwiki does seem a likely candidate to defer until needed, and if you do that the autocmd throws an error on startup:
Not too big of an issue since you can write a function to load vimwiki and do the setup, but just something to be aware of if this is going to be an official solution. |
Yeah, my solution is definitely a hack. I think the official solution should be a vimwiki_list config var. |
…(Issue vimwiki#892) Main change: Create function: normalize_syntax_settings(syntax) Problem: Some user prefer [[]] links more than [](). As vimwiki know both of them, they should be able to choose without regex mastery and with tests Solution: let g:vimwiki_syntax_variables.markdown.Link1 = vimwiki#vars#get_global('WikiLinkTemplate1')
This workaround works for me. However, |
First of all, thanks for all the tips shared here. Adding an autocmd as suggested by @ericboehs works for me too on the |
Any update on this? I'm also using Obsidian and it'd be great to be able to have markdown with [[wikilinks]]. |
Howdy folks, I put together a hacky workaround to get the backlinks working with double-square bracket link syntax. It also supports the "standard" Markdown syntax ( |
Exactly, editing with vimwiki and reading in Obsidian would be a great workflow for me. |
…(Issue vimwiki#892) Main change: Create function: normalize_syntax_settings(syntax) Problem: Some user prefer [[]] links more than [](). As vimwiki know both of them, they should be able to choose without regex mastery and with tests Solution: let g:vimwiki_syntax_variables.markdown.Link1 = vimwiki#vars#get_global('WikiLinkTemplate1')
Hey,
I'm new to github, apologies if this is not properly structure, if you need more info let me konw.
This is probably an easy solve but I am stuck trying to solve it. Any help or suggestions are greatly appreciated.
I'm on vimwiki Stable Version 2.5.
I recently moved my whole set up from ubuntu to manjaro kde plasma. Vimwiki is my post important vim plug-in and I absolutely love it.
I rebuilt my vimrc with all the plug-ins. vimwiki seems to work alright, the only problem I have is the ENTER fucnction.
When I press enter on some text to create a new vimwiki markdown file. I get this kind of situation.
[new note](new note)
I used to have this kind of result
[[new note]]
I really want to go back to the double bracket and I don't know why that changed since everything in my vimrc is the same.
I istanlled vim wiki with Plug like this:
Plug 'vimwiki/vimwiki'
Here I'll copy everything I have in my vimrc regarding vimwiki.
Vimrc
The text was updated successfully, but these errors were encountered: