Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions plugin/cfp.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
-- Create user commands for cfp.nvim
vim.api.nvim_create_user_command("CopyPath", function() require("cfp").copy_path() end, {
local commands = require("cfp.commands")

vim.api.nvim_create_user_command("CopyPath", function() commands.copy_path() end, {
desc = "Copy current file relative path to clipboard",
})

vim.api.nvim_create_user_command("CopyPathLine", function() require("cfp").copy_path_line() end, {
vim.api.nvim_create_user_command("CopyPathLine", function() commands.copy_path_line() end, {
desc = "Copy current file relative path with line number to clipboard",
})

vim.api.nvim_create_user_command("CopyBranchURL", function() require("cfp").copy_path_url() end, {
vim.api.nvim_create_user_command("CopyBranchURL", function() commands.copy_branch_url() end, {
desc = "Copy current file relative path as GitHub URL with branch name to clipboard",
})

vim.api.nvim_create_user_command("CopyBranchURLLine", function() require("cfp").copy_path_url() end, {
vim.api.nvim_create_user_command("CopyBranchURLLine", function() commands.copy_branch_url_line() end, {
desc = "Copy current file relative path with line number as GitHub URL with branch name to clipboard",
})

vim.api.nvim_create_user_command("CopyHashURL", function() require("cfp").copy_path_hash() end, {
vim.api.nvim_create_user_command("CopyHashURL", function() commands.copy_hash_url() end, {
desc = "Copy current file relative path as GitHub URL with commit hash to clipboard",
})

vim.api.nvim_create_user_command("CopyHashURLLine", function() require("cfp").copy_path_with_hash() end, {
vim.api.nvim_create_user_command("CopyHashURLLine", function() commands.copy_hash_url_line() end, {
desc = "Copy current file relative path with line number as GitHub URL with commit hash to clipboard",
})