michal-h21 / vim-zettel Goto Github PK
View Code? Open in Web Editor NEWVimWiki addon for managing notes according to Zettelkasten method
License: MIT License
VimWiki addon for managing notes according to Zettelkasten method
License: MIT License
Thanks for your work on this!
Is there a way to update the %title bit of the filename on save?
(When using let g:zettel_format = "%y%m%d-%H%M-%title")
Some other plain-text Zettelkasten plugins have the ability to see all backlinks for the a note.
Could vim-zettel implement something like this?
No mappings for this plugin and the vimwiki plugin are loading for me, although functions and otherwise appear to work which makes doing anything a gigantic pain.
The only clue I have now is this from dein log:
Error generating helptags:
Vim(helptags):E154: Duplicate tag "g:vimwiki_markdown_link_ext" in file /~/.cache/dein/.cache/init.vim/.dein/doc/zettel.txt
function dein#util#_check_vimrcs[15]..dein#recache_runtimepath[1]..dein#install#_recache_runtimepath[19]..<SNR>150_helptags, line 12
Any suggestions or help?
When I try to invoke :ZettelCapture on a file I get the following error:
Vimwiki Error: Wiki 1 is not registered in g:vimwiki_list!
This happens whether I invoke it from the command line via:
vim -c ZettelCapture filename
Or inside of of vim.
i'm wondering if the plugin could support folgezettel links which is indicated whith tripple bracket [[[link]]]]
?
i also include some reference about this type of link:
I tried starting with a fresh Vim configuration, reinstalling Vundle, fzf, fzf.vim, Vimwiki, and Vim-Zettel and rebuilding my configuration from scratch. I also tried configuring the g:zettel_fzf_command
variable with "rg --column --line-number --ignore-case --no-heading --color=always "
as I have both fzf and rg on my system and set the g:nv_search_paths
variable to the location of my zettelkasten. Nothing seems to make a difference.
Take this as a feature request please. I wonder if it is possible to create a plugin etc. to draw a usable graph of the network of all notes based on the links. I saw this on the foambubble project.
I changed the default file name to put the date at the end of the file name. After that I noticed that the template is not automatically applied when creating a new zettel. I did some experimenting and found that if I put a number at the beginning of the file name, the template works again.
These zettel names will bring in the template automatically:
[[2020-08-26-test-z|test-z]]
[[1test-it-2020-08-26|1test-it]]
These don't:
[[test-it-2020-08-26|test-it]]
[[-test-it-2020-08-26|-test-it]]
I would like to have the words come first in the file name, any ideas on how to get that to work?
It would be nice to update the Vim documentation with information from README.
ZettelNew does not use the template file when not created from an existing word/page (i.e. there is no backlink.)
Looks like that's a known issue based on a comment in autoload/zettel/vimwiki.vim
in function! zettel#vimwiki#zettel_new(...)
:
variables are available only when this function is called from
zettel_new_selected
...
let template = zettel#vimwiki#get_option("template")
if !empty(template)
let variables = get(a:, 2, 0)
if !empty(variables) " HERE is the check that fails
call zettel#vimwiki#expand_template(template, variables)
endif
endif
...
Originally posted by @Laptop765 in #27 (comment)
Thanks for this cool plugin! I'm experiencing an issue where VimwikiBacklinks
correctly shows backlinks, but when I run ZettelBackLinks
I get:
Error detected while processing function zettel#vimwiki#backlinks[14]..<SNR>127_insert_link_array:
line 2:
E119: Not enough arguments for function: vimwiki#base#update_listing_in_buffer
Any thoughts? The same thing happens for ZettelGenerateLinks
(VimwikiGenerateLinks
works).
VimwikiGenerateTagLinks creates or updates already created tags list, but ZettelGenerateTags only create new list. Maybe you can add something about ZettelRebuildTags for updating already created list, it would be very cool!
It's is possible to automatically run the ZettelBackLinks on the file save?
ZettelNew's default header used to generate something like:
---
title: Testing ZettelNew
date: 2020-03-10 12:16
---
But now generates something like:
%title Testing again
%date 2020-03-13 14:31
Could we reset the default to the original style, or at least remove the leading %
s if the ---
s are no longer wanted?
We use the VimwikiGet
function to get retrieve various information about the wiki. It seems that this function is no longer available in Vimwiki, there are various vimwiki#vars#
functions instead.
I have fzf installed but get the error when trying to do a ZettelSearch.
I would like to insert the preamble some additional options such as default bibtex file etc. My .vimrc
setting is the following:
let g:zettel_options = [{"front_matter" : { "tags" : "", "csl": "'/references/apa-tr.csl'", "bibliography": "'/references/zettel.bib'" }, "template" : "~/.vim/templates/zettel.tpl"}]
It does not matter in what order I put it, the preamble comes out the same:
---
title: Title
date: 2020-08-29 20:25
csl: '/references/apa-tr.csl'
tags:
bibliography: '/references/zettel.bib'
---
Whereas, I want the tags:
at the end:
---
title: Title
date: 2020-08-29 20:25
csl: '/references/apa-tr.csl'
bibliography: '/references/zettel.bib'
tags:
---
I tried the following with no success:
let g:zettel_options = [{"front_matter" : { "csl": "'/references/apa-tr.csl'", "bibliography": "'/references/zettel.bib'", "tags" : "" }, "template" : "~/.vim/templates/zettel.tpl"}]
It seems that it sorts additional options by the number of characters in option names (may be not). How can I force it to put tags:
at the end of the preamble?
Thanks for this wonderfull plugin. It makes my vim-zettelkasten-life so much easier :-)
I have the Notational FZF PlugIn installed. Is there any way to make vim-zettel use this kind of search with preview window?
I was wondering whether it would be feasible to add options to allow users to modify the default template for new zettels. For example, currently when a new zettel is created it generates a YAML with title and date. It would useful if users could specify in .vimrc a list of any additional items to include in the YAML (e.g. tags) as well as another list for any section headers to automatically add with specified header level (e.g. # or ##) and 1-2 new lines separating them. For example, I try to ensure every zettel has a "Related" section for links to related zettels and a "References" section for any books, journal articles, and so on referenced in the zettel. Would be handy if there were automatically added to any new zettel created.
You are unable to select and link to notes with colons (:) in their name.
Selecting a file with a colon in the Ag list will throw an error.
Its probably because of this line:
vim-zettel/autoload/zettel/fzf.vim
Line 22 in f9000b0
Hi,
Everything works great except T to yank the current zettel as a md link. Nothing happens when I press T.
I'm not sure what kind of info to give you to help.
Thanks for creating this repo. I plan to start using vim for a zettelkasten and this looks ideal to add the necessary additional functionality to vimwiki.
I was wondering in terms of basic setup whether it was possible to modify a variable so that new links are in markdown syntax rather than the default for vimwiki? Additionally, when creating new zettels if I have the following text:
this is a test
and select 'is' in visual mode - pressing z while creating a new zettel with only 'is' as the title, the rest of line is erroneously included in the link. Resulting in:
this [[180319-2212|is a test]]
rg is an alternative to ag, and fzf supports it
I'll probably try to add this feature, just need to figure out which arguments to pass to rg ...
Not sure if this is already implemented, but it'd be nice to search through files (something like Ctrl-P but which also works with titles) like [[
or ZettleSearch
does currently, but instead of inserting a link, open it instead.
I can use Ctrl-P if I have %title
in the filename, but I'd rather not go that way.
(Edit): :Ag
works as expected if vim is opened from the same dir as the wiki, and not when using the -c VimwikiIndex
command.
When deleting a note using vimwiki's \wd
command the corresponding entry in the .tags
file doesn't get deleted which gives an error when running ZettelGenerateTags
afterwards.
Thank you @michal-h21 for creating the plugin. I recently learned about zettlekasten method and exploring the plugin.
I was exploring the tags command but using ZettleGenerateTags doesn't generate any tags.I am confused about its usage.
It would be helpful if you share some example or workflow. eg. Adding tags manually to a zettle.
I would like my zettel to be available on github. So I have my vimwiki configured with let g:vimwiki_markdown_link_ext = 1
and it generates links like the following [title](link.md)
so I can use these links when commiting raw files on github.
But it seems that there is no way to set it up for vim-zettel. It generates links like that: [200716-1536](200716-1536)
@michal-h21 could you please let me know if it's possible to configure. Thanks!
Thanks for this plugin, it's been fabulous to use and has really changed how I work.
Do you have any plans to release it under an open source license (in a LICENSE file or README.md) for others to contribute?
so after typing [[
and getting FZF to pop up, I selected sarah.md
and the resulting output was [[sarah.md|
Thank you for this great work!
According to vimwiki's description of anchors, every header, tag, and bold text can be used as anchors.
The VimwikiBacklinks
command can list all of these types of anchors. However when using ZettelBackLinks
, it seems only full links without #
are recognized and generated below the Backlinks
section.
Links of this form [[title#bold text]]
are ignored. A support of titles and bold texts may allow fine-grained references between notes.
It would be nice if it was possible to generate outline of child notes of the current note. Possible caveat: when the note has backlink to the parent note, it is not possible to differentiate it from child notes. This may lead to outline that contain the whole Zettelkasten, which is not really desirable.
.vimrc
Plug 'vimwiki/vimwiki'
Plug 'michal-h21/vim-zettel'
let g:vimwiki_list = [{'path': '~/SynologyDrive/zettelkasten/', 'ext': '.txt'}]
let g:zettel_options = [{'template' : '/Users/adam/.vim/zettel_templates/default.tpl'}]
let g:zettel_format = "%raw_title"
I'm using the .txt extension here so I can easily view the files on my phone using the Synology Drive app. The files themselves are in vimwiki syntax.
default.tpl
= %title =
When using :ZettelNew Something
a file named Something.txt
is created, but the contents are using the default template:
%title Something
%date 2020-08-05 18:01
I have installed and made the configuration as readme file says, but when I enter into the vimwiki and type the command :ZettelNew it appears: "E492: Not an editor command: ZettelNew".
I'm on neovim rather than vim itself.
I know that it should be a silly question. Beg your pardon.
Regards
Hello, I've been using your awesome plugin and I make some settings for my workflow. After the last update when I want to generate a New Zettel this error echoes:
new zettel: 20200628212841-prueba2
Error detected while processing function zettel#vimwiki#zettel_new[23]..zettel#vimwiki#prepare_template_variables[3]..zettel#vimwiki#get_link[1]..zettel#vimwi
ki#get_title:
line 3:
E484: Can't open file 20200628212841-prueba2.md
Error detected while processing function zettel#vimwiki#zettel_new[23]..zettel#vimwiki#prepare_template_variables[7]..<SNR>121_read_footer:
line 1:
"20200628212841-prueba2.md" [New] 17L, 124C written
My settings in my .vimrc are:
" Zettel Vim
let g:vimwiki_list = [{"path":"~/Documents/Zettelkasten/", 'auto_tags': 1, 'auto_toc': 1, 'syntax': 'markdown', 'ext': '.md'}, {"path":"~/Documents/Zettelkasten/"}]
let g:vimwiki_use_mouse = 1
let g:vimwiki_auto_chdir = 1
let g:zettel_fzf_command = "rg --column --line-number --ignore-case --no-heading --color=always "
" let g:zettel_options = [{},{'front_matter' : {'tags' : ''}, 'template' : '~/Templates/zettel.tpl'}]
let g:zettel_options = [{"template" : "~/Templates/zettel.tpl"}]
let g:zettel_format = "%Y%m%d%H%M%S-%title"
" inoremap [[ [[<esc>:ZettelSearch<CR>
imap <silent> [[ [[<esc><Plug>ZettelSearchMap
nmap gZ <Plug>ZettelReplaceFileWithLink
" xnoremap z :call zettel#vimwiki#zettel_new_selected()<CR>
xmap z <Plug>ZettelNewSelectedMap
nnoremap <leader>zn :ZettelNew<SPACE>
nnoremap <leader>bl :VimwikiBacklinks<cr>
nmap <leader>T <Plug>ZettelYankNameMap
nnoremap <leader>zl :ZettelSearch<cr>
nnoremap <leader>gt :VimwikiRebuildTags!<cr>:VimwikiGenerateTagLinks<cr><c-l>
nnoremap <leader>O :ZettelOpen<cr>
" Pandoc
au FileType vimwiki call pandoc#completion#Init()
let g:vimwiki_filetypes = ['pandoc', 'markdown', 'textile']
let g:vimwiki_folding = 'custom'
let g:pandoc#filetypes#handled = ["pandoc", "markdown", "textile"]
let g:pandoc#folding#fdc = 0
let g:pandoc#folding#level = 999
let g:pandoc#folding#mode = 'stacked'
let g:pandoc#modules#enabled = ['folding', 'command', 'bibliographies', 'completion']
let g:pandoc#biblio#use_bibtool = 1
let g:pandoc#completion#bib#mode = 'citeproc'
let g:pandoc#biblio#bibs = ["/home/ivanvg/Documents/biblio.bib"]
I'm using VimWiki, vim-pandoc and vim-zettel. Maybe the error is related to Plug Conflicts.
My zettel plugin is:
---
title: "%title"
author:
date: "%date"
year:
tag:
---
Backlinks: %backlink
----
%footer
Thanks in advance
I was wondering if support for installing with vim-plug
was possible.
For now vim-zettel
can only be installed with Vundle, right?
When a link contains a file extension (ex: .md), the ZettelBackLinks call returns "No other file links to this file", although there is Zettel linking to the current one.
When removing the file extension, ZettelBackLinks is able to identify the link and create the appropriate backlink.
First of all, just wanted to say thanks for making this! I just recently found out about ZettelKasten and wanted to give it a shot. As a long time vimwiki user, I was trying to figure out how to adapt it to work for this new method.
It looks like the g:zettel_fzf_command
variable is overwritten in the plugin.
When setting let g:zettel_fzf_command = 'rg'
in my vimrc ag
is still used.
I think wrapping the setting of this variable in a conditional should prevent that.
I can open a PR to address this if you're open to it.
After resolving vimwiki/vimwiki#987
I'm bringing this here. I cannot follow links when this plugin is enabled, but when I removed it the ability to follow links returned.
I'm somewhat clueless to speculate, but its happening.
One problem I have had using this command is the following. If file A points to file B and I run :ZettelBackLinks
in file B, a link to file A will appear in the end of file B, which is fine. However, if I run :ZettelBackLinks
in file A, it will also show file B in its backlinks, but it is an artificial backlink.
Worse yet is that, if I remove the link from A to B in the body of the note, the links will remain in the Backlinks section.
Is it possible to modify the command so that it ignores links that appear after the Backlinks section?
Originally posted by @brunopc in #12 (comment)
Despite having several new, unlinked Zettel files, :ZettelInbox
is only generating this for me:
# Unlinked notes
[index](index)
I'm using nvim, and my (relevant) .config/nvim/init.vim is:
let g:vimwiki_list = [
\{'path': '/path/to/wiki/', 'syntax': 'markdown', 'ext': '.wiki'}
\]
" ## vim-zettel
" Filename format. The filename is created using strftime() function
let g:zettel_format = "%Y%m%d-%H%M"
" command used for VimwikiSearch
" possible values: "ag", "rg", "grep"
let g:zettel_fzf_command = "ag"
I tried to setup vim-zettel plugin following the README.md
I've got following plugins installed with Vundle
" My Plugins |
Plugin 'VundleVim/Vundle.vim' |~
Plugin 'vimwiki/vimwiki' |~
Plugin 'junegunn/fzf' |~
Plugin 'junegunn/fzf.vim' |~
Plugin 'michal-h21/vim-zettel'
$ cat .vimrc | grep -v ^\" | grep -v ^$
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vimwiki/vimwiki'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'michal-h21/vim-zettel'
call vundle#end() " required
filetype plugin indent on " required
let g:vimwiki_list = [{'path':'~/vimwiki/','ext':'.md','syntax':'markdown'}, {"path":"~/scratchbox/vimwiki/wiki/"}]
When I trying to type :Zettel I can see only ZettelCapture and ZettelInsertNote options.
According the documentation there are should be more available commands
Also typing :ZettelNew returns:
E492: Not an editor command: ZettelNew
I think I missed something during initial setup but I can't see any clues at the README.md
First of all, thanks for the effort you put into this project. I have only learned about the Zettelkasten method the day before yesterday, but this seems incredibly useful.
Having said that, I had some difficulties getting started with vim-zettel.
There are some issues you inevitably encounter when trying to use :ZettelCapture
(#10) or :ZettelNew
(#27) with a user-provided template. There are workarounds, but already I have to wonder if I am using vim-zettel as intended, since surely there must be some "happy path" where everything works fine if you stick to the intended workflow.
In this regard, some tutorial would be really helpful.
Furthermore, there seems to be quite some overlap between vim-zettel und vimwiki. If all I wanted to do is create and keep updating "some knowledge graph" - because right now, with my limited knowledge, this is what I perceive the Zettelkasten to be - the vimwiki functionality already seems to cover that, albeit as a newcomer I can't appreciate the finer details. What does vim-zettel buy you in addition?
vimwiki creates [[202005011153 Vimwiki]]
link style, but vim-zettel [202005011153 Vimwiki](202005011153 Vimwiki)
. Is this expected behavior?
I put this in my init.vim:
let g:vimwiki_list = [{'path': '~/Dropbox/D-Downloads/vimwikitest/',
\ 'syntax': 'markdown', 'ext': '.md',
\ 'maxhi': 1 }]
After updating to the latest version of vim-zettel I am now experiencing an error when creating new zettels. I have not changed my vim config or my template file.
Error detected while processing function zettel#vimwiki#zettel_new_selected[8]..zettel#vimwiki#zettel_new[25]..zettel
#vimwiki#expand_template:
line 3:
My vimrc has:
let g:zettel_options = [
\{},
\ {"front_matter" : {"tags" : ""}, "template" : "~/Dropbox/notes/zettel/template.tpl"}
Please let me know what additional info you need to help identify what is causing the error.
Looks like when trying to use the [[
search mapping with rg
instead of ag
there is an undefined function error calling the fzf plugin.
Steps to reproduce:
let g:zettel_fzf_command = 'rg'
in vimrc
[[
key map to create link to another ZettelI'm not sure how the fzf plugin works, but I'd be happy to take a look or help debug it.
While selecting a text and creating a new zettel, this happened:
It does not matter what the title says as long as there is a dot somewhere.
it'd be great if you could add feature allow us to create file using random id with optional length (prefer 7-8).
this could be done using mktemp XXXXXXX.md
for example
note: mktemp
in macOS doesn't have --suffix
option
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.