diff --git a/README.md b/README.md index 7cadb4b..ce7ac79 100644 --- a/README.md +++ b/README.md @@ -1 +1,94 @@ -# cfp.nvim \ No newline at end of file +# cfp.nvim + +A Neovim plugin for easily copying file paths and GitHub URLs to clipboard. + +## Features + +- 📋 Copy current file relative path to clipboard +- 📍 Copy current file path with line number +- 🔗 Copy current file path as GitHub URL with line number +- ⚡ Simple and lightweight +- 🎨 Customizable keymaps + +## Requirements + +- Neovim >= 0.7.0 +- Git (for GitHub URL functionality) + +## Installation + +### lazy.nvim + +```lua +{ + "tapihdev/cfp.nvim", + config = function() + require("cfp").setup() + end, +} +``` + +### packer.nvim + +```lua +use { + "tapihdev/cfp.nvim", + config = function() + require("cfp").setup() + end, +} +``` + +## Configuration + +Default configuration: + +```lua +require("cfp").setup({ + keymaps = { + copy_path = "cp", + copy_path_line = "cl", + copy_path_url = "cu", + }, +}) +``` + +To disable specific keymaps, set them to `nil`: + +```lua +require("cfp").setup({ + keymaps = { + copy_path = "cp", + copy_path_line = nil, -- disable this keymap + copy_path_url = "cu", + }, +}) +``` + +## Usage + +### Commands + +| Command | Description | +|---------|-------------| +| `:CopyPath` | Copy current file relative path to clipboard | +| `:CopyPathLine` | Copy current file relative path with line number to clipboard | +| `:CopyPathURL` | Copy current file relative path with line number as GitHub URL to clipboard | + +### Default Keymaps + +| Keymap | Command | Description | +|--------|---------|-------------| +| `cp` | `:CopyPath` | Copy file path | +| `cl` | `:CopyPathLine` | Copy file path with line number | +| `cu` | `:CopyPathURL` | Copy file path as GitHub URL | + +## Example Output + +- **CopyPath**: `lua/cfp/init.lua` +- **CopyPathLine**: `lua/cfp/init.lua:42` +- **CopyPathURL**: `https://github.com/tapihdev/cfp.nvim/blob/main/lua/cfp/init.lua#L42` + +## License + +Apache License 2.0 \ No newline at end of file