8000 GitHub - shazow/paint.nvim: Paint the background of your visual selection, useful for highlighting.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shazow/paint.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

paint.nvim

Paint the background of any visual selection or under your cursor.

image

Usage

Setup

require("paint").setup({
  -- Optional: Override the default brushes
  brushes = {
    { name = "Red",    bg = "#ff6b6b" },
    { name = "Blue",   bg = "#4ecdc4" },
    { name = "Green",  bg = "#95e1d3" },
    { name = "Yellow", bg = "#fce38a" },
    { name = "Purple", bg = "#c44569" },
    { name = "Orange", bg = "#f8b500" },
  },

  -- Optional: Add extra brushes to the default set
  extra_brushes = {
    { name = "Mint",     bg = "#00f5a0", fg = "#000000" },
    { name = "Lavender", bg = "#d8bfd8" },
  },
})

Commands

  • :Paint
  • :PaintSelect
  • :PaintClear

Mappings

vim.keymap.set("v", "<leader>p", ":Paint<CR>", { desc = "Paint selection" })
vim.keymap.set("n", "<leader>ps", ":PaintSelect<CR>", { desc = "Select paint brush" })
vim.keymap.set("n", "<leader>pc", ":PaintClear<CR>", { desc = "Clear paint" })

API

local Paint = require("paint")

Paint.paint() -- Paint the current cursor or selection
Paint.select_brush() -- Show selection UI
Paint.select_brush({ name = "Custom", fg = "#fffffff" }) -- Set your own brush
Paint.clear()
Paint.add_brush({ name = "Lavender", bg = "#d8bfd8" })
Paint.brushes() -- Return the saved brushes
Paint.selected_brush() -- Return the current brush

License

MIT

About

Paint the background of your visual selection, useful for highlighting.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0