Skip to content

You must be logged in to vote

a workaround could be to do something like this:

declare a local variable at the top of the lualine config that holds the branch name, and use the fmt function to grab it and push to that variable, then simply call that variable at the click event.

{
      "branch",
      fmt = function(str)
        branch_name = str
        return str
      end,
      on_click = function(_nb_of_clicks, _button, _modifiers)
        clip.copy(branch_name)
        print("To clipboard: " .. branch_name)
      end,
},

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@teto

Answer selected by teto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants