Skip to content

Highlighting an entire line #1013

Closed Answered by setseed13
setseed13 asked this question in Q&A
Jul 4, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Ok, in the end this was pretty easy. The pattern matching string is slightly different than what I found for lua, and setting up hihgligh groups was straight forward once I found out there is an api function.

In case anyone cares:

-- in some config file, e.g. init.lua
vim.api.nvim_set_hl(0, "hl_special_character", {fg="#6c71c4", bg=""})  -- this creates a new highlight group which can be called by mini.hipatterns

I only want to color the text, so I set fg and bg accordingly.

-- in the config file for hipatterns
require('mini.hipatterns').setup({
    highlighters = {
        special_character  = {
            pattern = " @@ ().*()", -- this expression looks for ` @@ ` and then matches aga…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@echasnovski
Comment options

@setseed13
Comment options

@echasnovski
Comment options

@setseed13
Comment options

Answer selected by setseed13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants