How do I use tables as entries? #1490
-
I have a command that returns a blob of json whicjh I am parsing into a lua table that Iwould like to pass into fzf. {
route = "ex-0002.xml",
sourcePath = "/home/user/forest/trees/ex-0002.tree",
tags = {},
taxon = vim.NIL,
title = "example"
} I would like the entry to display both the title and the route, but open the file in vim upon selection.
If I pass in the title, it displays correctly, but how can I then use the Thanks! Related: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See https://github.com/ibhagwan/fzf-lua/wiki, you can’t pass a table in the ways that you described (json key-value), to pass the data into {
“Line1”,
“Line2”,
} if you need access to metadata you’ll need to store it separately and have the line contain an index number (or any other identifier) so you can access the metadata, alternatively you can put the metadata into the line and hide it using |
Beta Was this translation helpful? Give feedback.
See https://github.com/ibhagwan/fzf-lua/wiki, you can’t pass a table in the ways that you described (json key-value), to pass the data into
fzf_exec
you’ll need to convert the data into a list of strings (usingstring.format
), I.e:if you need access to metadata you’ll need to store it separately and have the line contain an index number (or any other identifier) so you can access the metadata, alternatively you can put the metadata into the line and hide it using
--with-nth
(read man fzf).