Closed hajonnes closed 9 months ago
Hi, I have problem getting the templates working in with wiki.vim. I do not know vimscript and it seems problematic to debug.
It's not so hard when you know how. But knowing how do require some experience; so I'm not surprised that a lot of people find this to be hard.
Since I would not be able to create a nice wiki.vim with all bells and whistles from your description right now, but would like to be able to use your program I just copied your dotfiles.
Did you copy my dotnvim repo? Or my dotfiles repo? Or both?
On that note, If you ever feel like you have some time to spare, It would be great to see a screencast on your workflow with so many plugins for different stuff. To see it all come together.
I'm not sure; I don't really know how to do that. It would be easier to just have a video meeting to discuss and explain things. :p
Well anyway. I did not understand your descriptions on how to set up the templates. But together with the code I do understand a little. I got almost everything working, it is just the backlinks that does not work and have no idea why they do not.
I'll try and help!
the function, in the file
wiki.vim
…
That function will only add the backlink when you open a new page by following a link from an existing page. I use the personal#wiki#file_to_link
function to convert the file path in a:ctx.origin.origin
to a link format.
HOWEVER, it seems you have copied an old version of that file. This is the current version:
So now I wonder if you could help me on how to make a backlink form the working
a:ct.origin
?
I think you may be able to fix things by looking at my more recent version above. Let me know if I'm wrong.
A side note. Do you have any recommendations on a program to preview the markdown while I edit? I have tried some but I have yet to find one I really like.
To be honest, I don't use any previewers. I find Markdown is generally very easy to work with without rendering. So, I just work with my notes as pure text (markdown formatted - more or less, but with the .wiki
extension).
However, I did notice a few plugins and similar over the years:
And I'm sure there are more and perhaps better stuff available out there.
First of all, thanks for the help :)
One thing I would like to know is how to make links form file-searches. If I have a vague memory of the name of a file or what a file contains and search for it with ctrl-ow
or ctrl-ff
. I find it and want to insert a link to it. How can I do that easy? Or how is your method of linking files efficiently?
Did you copy my [dotnvim](https://github.com/lervag/dotnvim/) repo? Or my [dotfiles](https://github.com/lervag/dotfiles/) repo? Or both?
I do not remembered to be honest. What is the difference between the two and what would you recommend?
However, I did notice a few plugins and similar over the years:
https://github.com/iamcco/markdown-preview.nvim
https://instant-markdown.github.io/
https://github.com/ellisonleao/glow.nvim
I tried markdown-preview.nvim and peek.nvim. I ended up with peek, I do not know if it is the best but it is ok. I had a lot of problems with markdown-preview being slow and not staying put in the browser window I assigned it, but hijacking the browser I was reading from. If someone who is interested in previewers reads this :)
The last thing, if it is possible. It would be nice with a portable version of your setup of wiki.vim. I have tried vimwiki but do not like that it does not use .md syntax natively. I like your modular approach. But as a beginner I want something up and running with bells and whistles from the start, like I'm trying to do. Then when I have used it for some time and acquired knowledge of what I want I can get in to the settings. It would be nice if it was easy to download your current setup but with instructions on what I have to do to make it work on my computer, perhaps some instructions on your settings, like folding, not in-depth but so one could get by. And instructions on how to search, input links, modify template. I think a lot of people would switch form vimwiki or obsidian to wiki.vim if it was that easy. :)
One thing I would like to know is how to make links form file-searches. If I have a vague memory of the name of a file or what a file contains and search for it with
ctrl-ow
orctrl-ff
. I find it and want to insert a link to it. How can I do that easy? Or how is your method of linking files efficiently?
First, what do the mappings ctrl-ow
and ctrl-ff
do?
When I want to insert a link to a file, I usually do it the "hard way". I start typing [a text/label for the link](file:/path/to/file)
, where the path can be completed, which usually makes it quite fast to find the files I want. I don't do this very often, so I never really found a need to make it more efficient.
Did you copy my [dotnvim](https://github.com/lervag/dotnvim/) repo? Or my [dotfiles](https://github.com/lervag/dotfiles/) repo? Or both?
I do not remembered to be honest. What is the difference between the two and what would you recommend?
The dotnvim
repo contains my neovim configuration, whereas dotfiles
contains my other Linux configuration files (bashrc, zshrc, and a lot of other stuff).
I would (strongly!) recommend to build your own ;)
I know it can seem like a daunting task, and of course I think it is OK to be inspired by other peoples configuration. For instance, you could fork my configuration and use it as a basis for your own. But if you do, then I would strongly advice to read the entire configuration and remove things you don't need or things you don't understand. Make it more "minimal" and keep the things you thing seem useful to yourself. --- This will take a lot of time, but it will be time well spent. You should aim to understand your configuration!
I tried markdown-preview.nvim and peek.nvim. I ended up with peek, I do not know if it is the best but it is ok.
Cool, peek.nvim looks good.
The last thing, if it is possible. It would be nice with a portable version of your setup of wiki.vim.
Not sure I understand this. Why?
But as a beginner I want something up and running with bells and whistles from the start, like I'm trying to do. Then when I have used it for some time and acquired knowledge of what I want I can get in to the settings.
You really don't need much to get started:
If you follow the above procedure, it should not take you very long to have a working setup. If you use a distribution as a basis, then you will have more or less the bells and whistles from the start.
It would be nice if it was easy to download your current setup but with instructions on what I have to do to make it work on my computer, perhaps some instructions on your settings, like folding, not in-depth but so one could get by.
I don't have time to build and maintain anything like this, sorry.
And instructions on how to search, input links, modify template.
I think the documentation provides a lot of these instructions already.
I think a lot of people would switch form vimwiki or obsidian to wiki.vim if it was that easy. :)
Yes, you may be right. But I don't really have a lot of time, and I would rather spend my time actually improving the plugin. I do work quite hard on helping people who wants to use it, both with general support and by adding and adjusting features and fixing bugs. I don't want to also support a type of wiki.vim distribution on top of this.
Closing as there does not seem to be any further actions required here.
Hi, I have problem getting the templates working in with wiki.vim. I do not know vimscript and it seems problematic to debug. Since I would not be able to create a nice wiki.vim with all bells and whistles from your description right now, but would like to be able to use your program I just copied your dotfiles. On that note, If you ever feel like you have some time to spare, It would be great to see a screencast on your workflow with so many plugins for different stuff. To see it all come together.
Well anyway. I did not understand your descriptions on how to set up the templates. But together with the code I do understand a little. I got almost everything working, it is just the backlinks that does not work and have no idea why they do not.
the function, in the file
wiki.vim
gives me the name of the file:
but does not give me the backlink, which I think it should.
a:ctx.origin
gives me the path to the backlink, but something goes wrong when transforming it to a backlink, which I think it should, correct me if I'm wrong.e.g. This is the function I use right now. but it is cumbersome to transform the links by hand.
Output:
So now I wonder if you could help me on how to make a backlink form the working
a:ct.origin
?A side note. Do you have any recommendations on a program to preview the markdown while I edit? I have tried some but I have yet to find one I really like.
Edit, For the above function to work I had to change the below function in
packages.lua
.