https://github.com/hamidi-dev/kaleidosearch.nvim
A Neovim plugin that colorizes multiple search terms with multiple distinct colors for better visual tracking.
https://github.com/hamidi-dev/kaleidosearch.nvim
color colorize neovim plugin search
Last synced: about 1 year ago
JSON representation
A Neovim plugin that colorizes multiple search terms with multiple distinct colors for better visual tracking.
- Host: GitHub
- URL: https://github.com/hamidi-dev/kaleidosearch.nvim
- Owner: hamidi-dev
- Created: 2025-01-24T13:14:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-04T13:32:23.000Z (about 1 year ago)
- Last Synced: 2025-06-04T20:41:31.438Z (about 1 year ago)
- Topics: color, colorize, neovim, plugin, search
- Language: Lua
- Homepage:
- Size: 23.4 KB
- Stars: 25
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.org
Awesome Lists containing this project
README
#+AUTHOR: hamidi-dev
* Kaleidosearch.nvim
A Neovim plugin that colorizes *multiple search terms* with *multiple distinct colors* for better visual tracking.
https://github.com/user-attachments/assets/50a7bbdb-62c5-4c70-be10-86c48ea44d26
** Features
- Highlight multiple search terms with different colors
- Navigate between matches using standard search commands (n/N)
- Add words incrementally without losing existing highlights
- Add word under cursor with a single keymap AND remove it (toggle)
- Add visual selection to highlights
- dot-repeatable: Hit ~.~ at any point and the colors will change
** Installation
Using your favorite plugin manager:
*** lazy.nvim
#+begin_src lua
{
"hamidi-dev/kaleidosearch.nvim",
dependencies = {
"tpope/vim-repeat", -- optional for dot-repeatability
"stevearc/dressing.nvim", -- optional for nice input
},
config = function()
require("kaleidosearch").setup({
-- optional configuration
})
end,
}
#+end_src
*** packer.nvim
#+begin_src lua
use {
'hamidi-dev/kaleidosearch.nvim',
requires = {
'tpope/vim-repeat', -- optional for dot-repeatability
'stevearc/dressing.nvim', -- optional for nice input
},
config = function()
require('kaleidosearch').setup({
-- optional configuration
})
end
}
#+end_src
** Usage
| Command | Description |
|-------------------------------+----------------------------------------------|
| ~:Kaleidosearch word1 word2~ | Highlight specified words with colors |
| ~:KaleidosearchClear~ | Clear all highlighted words |
| ~:KaleidosearchAddWord~ | Add a new word to existing highlights |
| ~:KaleidosearchAddCursorWord~ | Add word under cursor to existing highlights |
** Default Keymaps
| Keymap | Action |
|--------------+----------------------------------------------------|
| ~cs~ | Open prompt for words to colorize |
| ~cc~ | Clear all highlighted words (reset to clean slate) |
| ~cn~ | Add a new word to existing highlights |
| ~ca~ | Add word under cursor to existing highlights |
** Configuration
#+begin_src lua
require("kaleidosearch").setup({
highlight_group_prefix = "WordColor_", -- Prefix for highlight groups
case_sensitive = false, -- Case sensitivity for matching
whole_word_match = false, -- Only match whole words, not substrings
keymaps = {
enabled = true, -- Set to false to disable default keymaps
open = "cs", -- Open input prompt for search
clear = "cc", -- Clear highlights (reset to clean slate)
add_new_word = "cn", -- Add a new word to existing highlights
add_cursor_word = "ca", -- Add word under cursor to highlights OR current visual selection
opts = {
noremap = true,
silent = true,
}
}
})
#+end_src
** Development
*** Running Tests
This plugin includes unit tests using Plenary.nvim. To run the tests:
1. Use the provided script (it will install Plenary.nvim if needed):
#+begin_src bash
./scripts/run_tests.sh
#+end_src
2. Or if you're inside Neovim with Plenary installed:
#+begin_src vim
:PlenaryBustedDirectory test/ {minimal_init = 'test/minimal_init.lua'}
#+end_src
** Misc.
- PRs welcome 😃
- Ideas / issues welcome
** License
MIT License