Skip to content

[Help] Is there a way to get the title of the current file as a variable? #133

Answered by mickael-menu
chikcne asked this question in Help
Discussion options

You must be logged in to vote

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}}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by chikcne
Comment options

You must be logged in to vote
1 reply
@mickael-menu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants