Quickselect is inspired by wezterm. It allows you to quickly jump to patterns in the buffer.
- Quickly jump to patterns in the buffer and select them
- Quick yank patterns in the buffer without moving the cursor
- Customizable patterns
With lazy.nvim
{
"ausgefuchster/quickselect.nvim",
event = "VeryLazy",
opts = {
patterns = {
-- Add your patterns here
},
keymap = {
{
mode = { 'n' },
'<leader>qs',
function()
require('quickselect').quick_select()
end,
desc = 'Quick select'
},
{
mode = { 'n' },
'<leader>qy',
function()
require('quickselect').quick_yank()
end,
desc = 'Quick yank'
}
},
},
}
Default Configuration
{
patterns = {
-- Hex color
"#%x%x%x%x%x%x",
-- Short-Hex color
"#%x%x%x",
-- RGB color
"rgb(%d+,%d+,%d+)",
-- IP Address
"%d+%.%d+%.%d+%.%d+",
-- Email
"%w+@%w+%.%w+",
-- URL
"https?://[%w-_%.%?%.:/%+=&]+",
-- 4+ digit number
"%d%d%d%d+",
-- File path
"~/[%w-_%.%?%.:/%+=&]+",
},
select_match = true,
use_default_patterns = true,
labels = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
keymap = {
},
}
Require quickselect
and call one of the following functions:
quick_select()
: Quick select patterns in the bufferquick_yank()
: Quick yank patterns in the buffer
require('quickselect').quick_select()
require('quickselect').quick_yank()