Skip to content

Solution for keymap to copy branch name #1520

Closed Answered by CKolkey
khaitranhq asked this question in Q&A
Discussion options

You must be logged in to vote

You could bind a keymapping to this function to accomplish that:

function()
  local current_branch = require("neogit.lib.git").branch.current()
  vim.cmd.let(("@+='%s'"):format(current_branch))
end

Hope that helps :)

Replies: 2 comments

Comment options

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

You must be logged in to vote
0 replies
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