Skip to content

Commit ca2b174

Browse files
committed
readme: Updated the readme, missing images and assets
1 parent ea42354 commit ca2b174

File tree

1 file changed

+171
-64
lines changed

1 file changed

+171
-64
lines changed

README.md

Lines changed: 171 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,210 @@
1-
# Cpy Buffers for Neovim
1+
# CpyBuffers.nvim
22

3-
Cpy Buffers is a Neovim plugin that leverages Telescope to enable copying the contents of multiple files into the clipboard with ease. It's designed to streamline the process of managing and manipulating files directly from Neovim, making it a valuable tool for developers.
3+
> 🔍 A powerful Neovim plugin for copying and managing file contents with an intuitive Telescope interface.
44
5-
## Demo
5+
[INSERT DEMO GIF/IMAGE HERE]
66

7-
https://github.com/adia-dev/cpy_buffers.nvim/assets/63371699/9c6a5090-4ffa-4b78-8296-a3391a17c840
7+
## ✨ Features
88

9-
## Requirements
9+
- 🚀 **Fast and Efficient**: Quick file content copying powered by Telescope's fuzzy finder
10+
- 📋 **Multi-Selection**: Select multiple files and copy their contents with ease
11+
- 🎨 **Rich Preview**: Built-in file preview with syntax highlighting
12+
- 🛠️ **Highly Configurable**: Customize everything from keymaps to display formats
13+
- 🎯 **Smart Filtering**: Advanced file filtering with ripgrep integration
14+
- 📝 **Buffer Labels**: Organize copied content with customizable file labels
1015

11-
- Neovim (0.8.0 or higher)
12-
- [Telescope](https://github.com/nvim-telescope/telescope.nvim)
13-
- [Ripgrep](https://github.com/BurntSushi/ripgrep) for efficient file searching
14-
- git, for handling gitignore functionality
16+
## 🖼️ Screenshots
1517

16-
## Installation
18+
[INSERT SCREENSHOTS HERE]
1719

18-
### Packer
20+
## 📥 Installation
1921

20-
If you're using Packer, add the following to your Neovim configuration:
22+
<details>
23+
<summary>Using <a href="https://github.com/folke/lazy.nvim">lazy.nvim</a></summary>
24+
25+
```lua
26+
{
27+
"adia-dev/cpy-buffers.nvim",
28+
dependencies = {
29+
"nvim-telescope/telescope.nvim",
30+
"nvim-lua/plenary.nvim",
31+
"nvim-tree/nvim-web-devicons", -- optional, for file icons
32+
},
33+
config = function()
34+
require("cpy_buffers").setup({
35+
-- your configuration
36+
})
37+
end,
38+
}
39+
```
40+
41+
</details>
42+
43+
<details>
44+
<summary>Using <a href="https://github.com/wbthomason/packer.nvim">packer.nvim</a></summary>
2145

2246
```lua
2347
use {
24-
'adia-dev/cpy_buffers',
25-
requires = { {'nvim-telescope/telescope.nvim'} }
48+
'adia-dev/cpy-buffers.nvim',
49+
requires = {
50+
'nvim-telescope/telescope.nvim',
51+
'nvim-lua/plenary.nvim',
52+
'nvim-tree/nvim-web-devicons', -- optional, for file icons
53+
},
54+
config = function()
55+
require('cpy_buffers').setup({
56+
-- your configuration
57+
})
58+
end
2659
}
2760
```
2861

29-
The process is similar for other package managers.
62+
</details>
63+
64+
## ⚡️ Quick Start
65+
66+
1. Open the file picker:
67+
68+
```lua
69+
-- Default keymap
70+
<leader>cb
71+
```
72+
73+
2. Select files using:
74+
75+
- `<TAB>` to toggle selection
76+
- `<C-a>` to select all
77+
- `<C-t>` to toggle all
78+
- `<CR>` to copy selected contents
79+
80+
[INSERT QUICK START GIF HERE]
81+
82+
## ⚙️ Configuration
3083

31-
## Configuration
84+
Here's a basic configuration with default values:
3285

33-
To initialize the plugin with (optional) custom configurations, add the following to your Neovim setup, here are the default configurations:
86+
```lua
87+
require("cpy_buffers").setup({
88+
register = "+", -- Copy to system clipboard
89+
selection_indicator = "", -- Selected files indicator
90+
selection_caret = "", -- Selection cursor indicator
91+
92+
-- Optional: Customize keymaps
93+
keymaps = {
94+
open_picker = "<leader>cb",
95+
toggle_selection = "<TAB>",
96+
fast_copy_all = "<C-a>",
97+
toggle_all = "<C-t>",
98+
},
99+
})
100+
```
101+
102+
<details>
103+
<summary>🔧 Full Configuration</summary>
34104

35105
```lua
36-
require('cpy_buffers').setup({
37-
-- register to use for copy operations
38-
-- e.g: `+` will use the system clipboard (default)
39-
-- e.g: `"` will use the unnamed register, good for yanking inside vim
40-
register = "+",
106+
{
107+
register = "+", -- "+" Copy to the host machine clipboard
108+
selection_indicator = "", -- Icon for selected entries
109+
selection_caret = "", -- Icon for the selection caret
41110
keymaps = {
42-
open_picker = "<leader>fc",
43-
toggle_hidden = "<leader>g",
111+
open_picker = "<leader>cb",
44112
toggle_selection = "<TAB>",
45113
fast_copy_all = "<C-a>",
46114
toggle_all = "<C-t>",
47-
label_buffers = true, -- show buffer labels at the top of each buffer
48-
-- format string for buffer labels at the top of each buffer
49-
-- %f will be replaced with the buffer's relative path to the directory
50-
-- %c will be replaced with the buffer's short name
51-
-- %a will be replaced with the buffer's absolute path
52-
-- TODO: %n will be replaced with the buffer's number
53-
-- TODO: %m will be replaced with the buffer's modified status
54-
-- e.g: "%n %c %m" will result in "1 init.lua [+]"
55-
-- e.g: "%f" will result in "lua/cpy_buffers"
56-
-- e.g: "// %a" will result in "// /home/user/.../lua/cpy_buffers/init.lua"
57-
-- e.g: "# %f" will result in "# lua/cpy_buffers"
58-
label_format = "# %c",
59115
activate_all_visible = "<C-v>",
60116
deactivate_all_visible = "<C-d>",
61117
invert_selection = "<C-r>",
118+
toggle_hidden = "<leader>g",
119+
copy_to_buffer = "<C-b>",
120+
save_to_file = "<C-s>",
121+
copy_paths = "<C-p>",
62122
},
63-
hide_hidden_files = true,
64-
prompt_title = "Cpy Buffers",
65-
-- Additional options for the `rg` command, e.g. "--hidden --no-ignore"
66-
additional_rg_options = "",
67-
})
123+
highlights = {
124+
multi_selection = {
125+
guifg = "#7aa2f7", -- Brighter blue for active selection
126+
guibg = "#292e42", -- Slightly lighter gray-blue for active background
127+
},
128+
},
129+
log = {
130+
use_notify = true,
131+
level = vim.log.levels.DEBUG,
132+
},
133+
-- Change the layout of the picker
134+
-- layout_config = {
135+
-- width = 0.8,
136+
-- height = 0.9,
137+
-- prompt_position = "top",
138+
-- preview_cutoff = 120,
139+
-- horizontal = {
140+
-- preview_width = 0.6,
141+
-- },
142+
-- },
143+
display = {
144+
label_buffers = true,
145+
label_format = "-- %c --",
146+
prompt_title = "Cpy Buffers",
147+
content_separator = "\n\n",
148+
show_icons = true,
149+
},
150+
file_search = {
151+
hide_hidden_files = true,
152+
additional_rg_options = "",
153+
include_extensions = {},
154+
exclude_patterns = { "node_modules/*", "vendor/*" },
155+
},
156+
sorting = {
157+
sort_by_modification = false,
158+
sort_by_size = false,
159+
sort_by_extension = false,
160+
use_custom_sorter = false,
161+
},
162+
}
68163
```
69164

70-
### Default Keymaps
165+
</details>
166+
167+
<!-- TODO: write the CONFIGURATION.md file -->
168+
<!-- See [detailed configuration](./CONFIGURATION.md) for all options. -->
169+
170+
## 🎮 Default Keymaps
71171

72-
- `<leader>fc`: Open the file picker
73-
- `<leader>g`: Toggle visibility of hidden files
74-
- `<TAB>`: Toggle selection of a file
75-
- `<C-a>`: Copy the contents of all selected files to the clipboard
76-
- `<C-t>`: Toggle the selection of all files
77-
- `<C-v>`: Activate all visible files in the picker
78-
- `<C-d>`: Deactivate all visible files in the picker
79-
- `<C-r>`: Invert the current selection
172+
| Key | Action |
173+
| ------------ | -------------------- |
174+
| `<leader>cb` | Open file picker |
175+
| `<TAB>` | Toggle selection |
176+
| `<C-a>` | Copy all files |
177+
| `<C-t>` | Toggle all files |
178+
| `<C-v>` | Select all visible |
179+
| `<C-d>` | Deselect all visible |
180+
| `<C-r>` | Invert selection |
181+
| `<leader>g` | Toggle hidden files |
182+
| `<C-b>` | Copy to new buffer |
183+
| `<C-s>` | Save to file |
184+
| `<C-p>` | Copy file paths |
80185

81-
You can customize these keymaps in the setup configuration.
186+
## 📚 Commands
82187

83-
## Usage
188+
| Command | Description |
189+
| -------------------------- | ---------------------- |
190+
| `:CpyBufChangeRgCommand` | Modify ripgrep options |
191+
| `:CpyBufToggleGitignore` | Toggle hidden files |
192+
| `:CpyBufChangeLabelFormat` | Change label format |
84193

85-
After installation and configuration, use the plugin by invoking the file picker with the configured shortcut (default: `<leader>fc`). Within the picker:
194+
## 🔧 Advanced Usage
86195

87-
- Use `<TAB>` to select or deselect files.
88-
- Press `<C-a>` to copy the contents of all selected files to the clipboard.
89-
- Adjust visibility of hidden files and change `rg` command options directly from Neovim's command line interface or through the plugin's setup configuration.
196+
For detailed information about advanced features and customization options, check out our [Advanced Usage Guide](./ADVANCED.md).
90197

91-
## Extending and Customizing
198+
## 🤝 Contributing
92199

93-
Cpy Buffers allows for extensive customization. You can modify key bindings, toggle gitignore filtering, and change `rg` command options to fit your workflow.
200+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
94201

95-
### Commands
202+
## 📄 License
96203

97-
- `:CpyBufChangeRgCommand`: Change the `rg` command options for file searching.
98-
- `:CpyBufToggleGitignore`: Toggle the inclusion of hidden files in the search results.
99-
- `:CpyBufChangeLabelFormat`: Change the format of the buffer labels at the top of each buffer.
204+
MIT License - see the [LICENSE](LICENSE) file for details
100205

101-
## Contributing
206+
---
102207

103-
Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.
208+
<div align="center">
209+
Made with ❤️ by adia-dev
210+
</div>

0 commit comments

Comments
 (0)