Comments (5)
Hi, sorry for the late reply. The support for the current Vimwiki version should work now.
from vim-zettel.
Okay, figured it out. I'm using a later version of vimwiki where the signature of update_listing_in_buffer
has changed. Now it takes a generator for the first argument, and has an additional create argument.
I've never used vimscript before but I got it mostly working by changing insert_link_array
like this:
" insert list of links to the current page
function! s:insert_link_array(title, lines)
let links_rx = '\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxListBullet').'\)'
" I have no idea how to just close over the argument directly
let s:_lines = a:lines
let GeneratorLinks = copy(l:)
function! GeneratorLinks.f() abort
return s:_lines
endfunction
call vimwiki#base#update_listing_in_buffer(GeneratorLinks, a:title, links_rx, line('$')+1, 1, 1)
endfunction
Now it appears to work. I just cobbled this together from copying the vimwiki code as I've never written VimL, so if anyone has some suggestions to spruce it up I'm all 👂.
from vim-zettel.
Thanks for the patch. I have the same problem. Can you create a PR?
from vim-zettel.
Having the same issue here.
from vim-zettel.
Came across this just now too. I closed over the arguments
" insert list of links to the current page
function! s:insert_link_array(title, lines)
let links_rx = '\m^\s*'.vimwiki#u#escape(vimwiki#lst#default_symbol()).' '
let gen = { 'lines': a:lines }
function! gen.f() abort
return self.lines
endfunction
call vimwiki#base#update_listing_in_buffer(gen, a:title, links_rx, line('$')+1, 1, 1)
endfunction
Should also be applied to zettel#vimwiki#generate_tags
at the end of the file as that also calls vimwiki#base#update_listing_in_buffer
. That change would look like this
let links_rx = '\m\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxH2').'\)\|\%(^\s*'
\ .vimwiki#u#escape(vimwiki#lst#default_symbol()).' '
\ .vimwiki#vars#get_syntaxlocal('rxWikiLink').'$\)'
let gen = { 'lines': lines }
function! gen.f() abort
return self.lines
endfunction
call vimwiki#base#update_listing_in_buffer(gen, 'Generated Tags', links_rx, line('$')+1, 1, 1)
from vim-zettel.
Related Issues (20)
- Add `%random` variable for template files HOT 1
- ZettelInsertNote fails with multiple wikis: Can't open file... HOT 1
- ZettelInbox indiscriminately adds all zettels to the page HOT 3
- Front Matter not included in YAML HOT 5
- Generate ID in template HOT 2
- Flying Zettels/Buffers HOT 6
- Make :ZettelOpen jump to correct line HOT 4
- Would it be possible to use Telescope rather than fzf? HOT 9
- Linking visually selected text to an existing zettel HOT 3
- Allow for NV-like creation of new zettel HOT 1
- Error when running ZettelInbox on Vimwiki dev branch HOT 4
- ZettelSearch and insert mode HOT 1
- :ZettelSearch and :NV search different things HOT 1
- Feature Request: ZettelOrphanedPages?ZettelOrphans
- Should this work in Neovim? I cannot make it create notes anywhere but current directory HOT 7
- :ZettelOpen & :ZettelSearch don't work HOT 8
- Disregard
- Question: Using vim-zettel with 11ty - Generating 11ty links on output HOT 1
- Create zettels in a subfolders? HOT 12
- Zettels are not created in the current subfolder. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-zettel.