Skip to content

๐Ÿš€ Enhance your Neovim workflow with Cpy Buffers! ๐Ÿ“โœ‚๏ธ A Telescope-powered plugin to swiftly copy contents from multiple files, boosting productivity and streamlining your development process.

Notifications You must be signed in to change notification settings

adia-dev/cpy_buffers.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CpyBuffers.nvim

๐Ÿ” A powerful Neovim plugin for copying and managing file contents with an intuitive Telescope interface.

Screen.Recording.2024-11-24.at.01.33.29.mov

โœจ Features

  • ๐Ÿš€ Fast and Efficient: Quick file content copying powered by Telescope's fuzzy finder
  • ๐Ÿ“‹ Multi-Selection: Select multiple files and copy their contents with ease
  • ๐ŸŽจ Rich Preview: Built-in file preview with syntax highlighting
  • ๐Ÿ› ๏ธ Highly Configurable: Customize everything from keymaps to display formats
  • ๐ŸŽฏ Smart Filtering: Advanced file filtering with ripgrep integration
  • ๐Ÿ“ Buffer Labels: Organize copied content with customizable file labels

๐Ÿ–ผ๏ธ Screenshots

image image

๐Ÿ“ฅ Installation

Using lazy.nvim
{
  "adia-dev/cpy-buffers.nvim",
  dependencies = {
    "nvim-telescope/telescope.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons", -- optional, for file icons
  },
  config = function()
    require("cpy_buffers").setup({
      -- your configuration
    })
  end,
}
Using packer.nvim
use {
  'adia-dev/cpy-buffers.nvim',
  requires = {
    'nvim-telescope/telescope.nvim',
    'nvim-lua/plenary.nvim',
    'nvim-tree/nvim-web-devicons', -- optional, for file icons
  },
  config = function()
    require('cpy_buffers').setup({
      -- your configuration
    })
  end
}

โšก๏ธ Quick Start

  1. Open the file picker:
-- Default keymap
<leader>cb
  1. Select files using:
  • <TAB> to toggle selection
  • <C-a> to select all
  • <C-t> to toggle all
  • <CR> to copy selected contents

[INSERT QUICK START GIF HERE]

โš™๏ธ Configuration

Here's a basic configuration with default values:

require("cpy_buffers").setup({
  register = "+", -- Copy to system clipboard
  selection_indicator = "โœ”", -- Selected files indicator
  selection_caret = "โžœ ", -- Selection cursor indicator

  -- Optional: Customize keymaps
  keymaps = {
    open_picker = "<leader>cb",
    toggle_selection = "<TAB>",
    fast_copy_all = "<C-a>",
    toggle_all = "<C-t>",
  },
})
๐Ÿ”ง Full Configuration
{
	register = "+", -- "+" Copy to the host machine clipboard
	selection_indicator = "โœ”", -- Icon for selected entries
	selection_caret = "โžœ ", -- Icon for the selection caret
	keymaps = {
		open_picker = "<leader>cb",
		toggle_selection = "<TAB>",
		fast_copy_all = "<C-a>",
		toggle_all = "<C-t>",
		activate_all_visible = "<C-v>",
		deactivate_all_visible = "<C-d>",
		invert_selection = "<C-r>",
		toggle_hidden = "<leader>g",
		copy_to_buffer = "<C-b>",
		save_to_file = "<C-s>",
		copy_paths = "<C-p>",
	},
	highlights = {
		multi_selection = {
			guifg = "#7aa2f7", -- Brighter blue for active selection
			guibg = "#292e42", -- Slightly lighter gray-blue for active background
		},
	},
	log = {
		use_notify = true,
		level = vim.log.levels.DEBUG,
	},
	-- Change the layout of the picker
	-- layout_config = {
	-- 	width = 0.8,
	-- 	height = 0.9,
	-- 	prompt_position = "top",
	-- 	preview_cutoff = 120,
	-- 	horizontal = {
	-- 		preview_width = 0.6,
	-- 	},
	-- },
	display = {
		label_buffers = true,
		label_format = "-- %c --",
		prompt_title = "Cpy Buffers",
		content_separator = "\n\n",
		show_icons = true,
	},
	file_search = {
		hide_hidden_files = true,
		additional_rg_options = "",
		include_extensions = {},
		exclude_patterns = { "node_modules/*", "vendor/*" },
	},
	sorting = {
		sort_by_modification = false,
		sort_by_size = false,
		sort_by_extension = false,
		use_custom_sorter = false,
	},
}

๐ŸŽฎ Default Keymaps

Key Action
<leader>cb Open file picker
<TAB> Toggle selection
<C-a> Copy all files
<C-t> Toggle all files
<C-v> Select all visible
<C-d> Deselect all visible
<C-r> Invert selection
<leader>g Toggle hidden files
<C-b> Copy to new buffer
<C-s> Save to file
<C-p> Copy file paths

๐Ÿ“š Commands

Command Description
:CpyBufChangeRgCommand Modify ripgrep options
:CpyBufToggleGitignore Toggle hidden files
:CpyBufChangeLabelFormat Change label format

๐Ÿ”ง Advanced Usage

For detailed information about advanced features and customization options, check out our Advanced Usage Guide.

๐Ÿค Contributing

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.

๐Ÿ“„ License

MIT License - see the LICENSE file for details


Made with โค๏ธ by adia-dev

About

๐Ÿš€ Enhance your Neovim workflow with Cpy Buffers! ๐Ÿ“โœ‚๏ธ A Telescope-powered plugin to swiftly copy contents from multiple files, boosting productivity and streamlining your development process.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages