DATAVIEW alternatives in nvim #713
Replies: 3 comments 3 replies
-
|
I like that this approach is understandable and easy for most folks to extend. The closest I've found to dataview in Neovim is dynomark and it's plugin, but it's written in Go and I'm not familiar with that language. I agree that a dataview alternative is sorely needed! |
Beta Was this translation helpful? Give feedback.
-
|
Update: It's a command-line tool, it can be integrated into Neovim, with the perec Plugin from the same author: Though I'm not quite sure if Perec works well in parallel to obsidian.nvim: Some of the feature of perec are redundant to obsidian.nvim |
Beta Was this translation helpful? Give feedback.
-
|
just brainstorming here... I currently use markdown-toc to update a TOC for my current file on save. It updates the text between two specific HTML comments (I have it set to Perhaps a dataview alternative could take the form of a supplemental plugin, which queries a list of files (interacting with obsidian.nvim), and then inserts a list of links. Arguments to the query could be specified in the comment line, or the user could define some presets in their configuration. It might look something like <!-- mview-start tags: [project/open, !archive] -->
<!-- mview-end -->or <!-- mview-start name: my-special-query -->
<!-- mview-end -->Queries might be defined by callback functions, either using some kind of API, or user-written lua. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
Lots of people use DATAVIEW as a plugin in Obsidian.
I haven't found some similar for Neovim.
So I wanted to start a discussion and give a starting point for people, who are inexperienced like me :-)
(I know this is somewhat hacky - please improve and comment if you can )
1. A simple customised telescope prompt
A telescope prompt could be an alternative for very simple Dataview usage.
So for example I want to have a list of all my notes with active projects.
These have a frontmatter with:
in init.lua:
projekt_liste_picker = function() require("telescope.builtin").live_grep({ cwd="/path/to/your/vault", -- this is the regex search with two keywords default_text="type: project.*status: open", -- I like normal mode, so I can go up/down with j/k quickly initial_mode = "normal", vimgrep_arguments={ "rg", "--color=never", "-l", -- list matching file only fonce -- I don't want templates to show, so I exclude these here: "--iglob=!templates", "--no-heading", "--multiline", "--multiline-dotall", "--with-filename", "--line-number", "--column", "--smart-case", } })2. A Python Script
Now this is much better :-D
Same application: I want to have a list with active projects.
Here it is written into a md-file inside my vault adding additional metadata.
Setup of python:
OUTPUT:
For easier acces I have in my init.lua:
of course you could do the same with autocmd
3. Further ideas:
(Look into pandas.DataFrame.from_dict)
Obviously
#tagsare not taken into consideration, but Dataview looks for them, too.Beta Was this translation helpful? Give feedback.
All reactions