Skip to content

🔗 Auto generate remote repository link for Neovim written in Lua

License

Notifications You must be signed in to change notification settings

mistricky/code-link.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 default
  origin = '...',

  -- (Optional) If the copy_command is passed, code-link will exec the copy_command after generated share link every time
  copy_command = function(link)
		return 'echo "' .. link .. '" | pbcopy'
	end,
})

LICENSE

MIT.

About

🔗 Auto generate remote repository link for Neovim written in Lua

Resources

License

Stars

Watchers

Forks

Packages

No packages published