Skip to content

Repository files navigation

code-link.nvim logo

🔗 Code-link.nvim

Neovim plugin that make sharing code location easier written in Lua

Screen.Recording.2024-02-10.at.22.01.26.mov

Installation

It is suggested to either use the latest release tag

Install with Lazy.nvim

require("lazy").setup({
"mistricky/code-link.nvim",
-- ...
})

Commands

There is only one command CodeLink you need to use, which allows you to create a share link by your origin address and branch name of the current git repository. And if you want to specify the branch name explicitly, just pass the branch name as args to the CodeLink command:

CodeLink branch_name # Create a share link with specific branch name
CodeLink # Create a share link with the current branch name

Configuration

You can pass some configure items by the setup function, here is an example show you how to configure code-link:

require('code-link').setup({
-- (Optional) Use value of the "origin" of git remote config by defaultorigin='...',
-- (Optional) If the copy_command is passed, code-link will exec the copy_command after generated share link every timecopy_command=function(link)
return'echo "' ..link..'" | pbcopy'end,
})

LICENSE

MIT.

About

🔗 Auto generate remote repository link for Neovim written in Lua

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages