[Help] Is there a way to get the title of the current file as a variable? #133
-
Verify
How can we help you?I want to display the title of the file displayed by the buffer as the winbar text. Is there a way to grab the title of the file from |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can try this in lua: require('zk.api').list(
nil,
{ hrefs = { vim.fn.expand('%') }, select = {"title"} },
function(err, res)
print(res[1]["title"])
end
) Or if you want to use an ex command, go straight to the CLI tool: !zk list % -q --format {{title}} |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, for the Lua script, as I understand it the In the meantime something like
|
Beta Was this translation helpful? Give feedback.
You can try this in lua:
Or if you want to use an ex command, go straight to the CLI tool: