mistricky / code-link.nvim

πŸ”— Auto generate remote repository link for Neovim written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Lua 84.2%Language:Python 15.8%