-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(integration): add reactive.nvim integration (#654)
* feat(reactive): add preset builder * feat(reactive): add presets for every catppuccin flavour * docs(reactive): add reactive.nvim integration info * docs(reactive): update integration setup
- Loading branch information
1 parent
c2e6f8e
commit 151e478
Showing
10 changed files
with
347 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
local M = {} | ||
|
||
function M.cursor(name, palette) | ||
return { | ||
name = name, | ||
init = function() vim.opt.guicursor:append "a:ReactiveCursor" end, | ||
modes = { | ||
i = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.teal }, | ||
}, | ||
}, | ||
no = { | ||
operators = { | ||
d = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.red }, | ||
}, | ||
}, | ||
y = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.peach }, | ||
}, | ||
}, | ||
c = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.blue }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
R = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.sapphire }, | ||
}, | ||
}, | ||
-- visual | ||
[{ "v", "V", "\x16" }] = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.mauve }, | ||
}, | ||
}, | ||
-- select | ||
[{ "s", "S", "\x13" }] = { | ||
hl = { | ||
ReactiveCursor = { bg = palette.pink }, | ||
}, | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
function M.cursorline(name, palette) | ||
local darken = require("catppuccin.utils.colors").darken | ||
|
||
return { | ||
name = name, | ||
static = { | ||
winhl = { | ||
inactive = { | ||
CursorLine = { bg = darken(palette.surface0, 0.75) }, | ||
CursorLineNr = { bg = darken(palette.surface0, 0.75) }, | ||
}, | ||
}, | ||
}, | ||
modes = { | ||
-- insert mode | ||
i = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.sky, 0.3) }, | ||
CursorLineNr = { bg = darken(palette.sky, 0.3) }, | ||
}, | ||
}, | ||
-- normal mode | ||
n = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface0 }, | ||
CursorLineNr = { bg = palette.surface0 }, | ||
}, | ||
}, | ||
-- operator-pending mode | ||
no = { | ||
operators = { | ||
[{ "gu", "gU", "g~", "~" }] = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface2 }, | ||
CursorLineNr = { bg = palette.surface2 }, | ||
}, | ||
}, | ||
-- delete operator | ||
d = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.red, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.red, 0.4) }, | ||
}, | ||
}, | ||
-- yank operator | ||
y = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.peach, 0.3) }, | ||
CursorLineNr = { bg = darken(palette.peach, 0.3) }, | ||
}, | ||
}, | ||
-- change operator | ||
c = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.blue, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.blue, 0.4) }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
R = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.sapphire, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.sapphire, 0.4) }, | ||
}, | ||
}, | ||
-- visual mode | ||
[{ "v", "V", "\x16" }] = { | ||
winhl = { | ||
Visual = { bg = darken(palette.mauve, 0.4) }, | ||
}, | ||
}, | ||
-- select mode | ||
[{ "s", "S", "\x13" }] = { | ||
winhl = { | ||
Visual = { bg = darken(palette.pink, 0.4) }, | ||
}, | ||
}, | ||
}, | ||
} | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
local palette = require("catppuccin.palettes").get_palette "frappe" | ||
local presets = require "catppuccin.utils.reactive" | ||
|
||
return presets.cursor("catppuccin-frappe-cursor", palette) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
local darken = require("catppuccin.utils.colors").darken | ||
local palette = require("catppuccin.palettes").get_palette "frappe" | ||
|
||
return { | ||
name = "catppuccin-frappe-cursorline", | ||
static = { | ||
winhl = { | ||
inactive = { | ||
CursorLine = { bg = darken(palette.surface0, 0.85) }, | ||
CursorLineNr = { bg = darken(palette.surface0, 0.85) }, | ||
}, | ||
}, | ||
}, | ||
modes = { | ||
i = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.sky, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.sky, 0.4) }, | ||
}, | ||
}, | ||
n = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface0 }, | ||
CursorLineNr = { bg = palette.surface0 }, | ||
}, | ||
}, | ||
no = { | ||
operators = { | ||
[{ "gu", "gU", "g~", "~" }] = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface2 }, | ||
CursorLineNr = { bg = palette.surface2 }, | ||
}, | ||
}, | ||
-- delete operator | ||
d = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.red, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.red, 0.4) }, | ||
}, | ||
}, | ||
-- yank operator | ||
y = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.peach, 0.4) }, | ||
CursorLineNr = { bg = darken(palette.peach, 0.4) }, | ||
}, | ||
}, | ||
-- change operator | ||
c = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.blue, 0.5) }, | ||
CursorLineNr = { bg = darken(palette.blue, 0.5) }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
-- replace mode | ||
R = { | ||
winhl = { | ||
CursorLine = { bg = darken(palette.sapphire, 0.5) }, | ||
CursorLineNr = { bg = darken(palette.sapphire, 0.5) }, | ||
}, | ||
}, | ||
-- visual mode | ||
[{ "v", "V", "\x16" }] = { | ||
winhl = { | ||
Visual = { bg = darken(palette.mauve, 0.4) }, | ||
}, | ||
}, | ||
-- select mode | ||
[{ "s", "S", "\x13" }] = { | ||
winhl = { | ||
Visual = { bg = darken(palette.pink, 0.4) }, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
local palette = require("catppuccin.palettes").get_palette "latte" | ||
local presets = require "catppuccin.utils.reactive" | ||
|
||
local preset = presets.cursor("catppuccin-latte-cursor", palette) | ||
|
||
preset.modes.R.hl.ReactiveCursor = { bg = palette.flamingo } | ||
|
||
return preset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
local lighten = require("catppuccin.utils.colors").lighten | ||
local palette = require("catppuccin.palettes").get_palette "latte" | ||
|
||
return { | ||
name = "catppuccin-latte-cursorline", | ||
static = { | ||
winhl = { | ||
inactive = { | ||
CursorLine = { bg = lighten(palette.surface0, 0.5) }, | ||
CursorLineNr = { bg = lighten(palette.surface0, 0.5) }, | ||
}, | ||
}, | ||
}, | ||
modes = { | ||
i = { | ||
winhl = { | ||
CursorLine = { bg = lighten(palette.teal, 0.4) }, | ||
CursorLineNr = { bg = lighten(palette.teal, 0.4) }, | ||
}, | ||
}, | ||
n = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface0 }, | ||
CursorLineNr = { bg = palette.surface0 }, | ||
}, | ||
}, | ||
no = { | ||
operators = { | ||
[{ "gu", "gU", "g~", "~" }] = { | ||
winhl = { | ||
CursorLine = { bg = palette.surface2 }, | ||
CursorLineNr = { bg = palette.surface2 }, | ||
}, | ||
}, | ||
-- delete operator | ||
d = { | ||
winhl = { | ||
CursorLine = { bg = lighten(palette.red, 0.3) }, | ||
CursorLineNr = { bg = lighten(palette.red, 0.3) }, | ||
}, | ||
}, | ||
-- yank operator | ||
y = { | ||
winhl = { | ||
CursorLine = { bg = lighten(palette.peach, 0.3) }, | ||
CursorLineNr = { bg = lighten(palette.peach, 0.3) }, | ||
}, | ||
}, | ||
-- change operator | ||
c = { | ||
winhl = { | ||
CursorLine = { bg = lighten(palette.blue, 0.3) }, | ||
CursorLineNr = { bg = lighten(palette.blue, 0.3) }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
-- visual | ||
[{ "v", "V", "\x16" }] = { | ||
winhl = { | ||
Visual = { bg = lighten(palette.mauve, 0.3) }, | ||
}, | ||
}, | ||
-- select | ||
[{ "s", "S", "\x13" }] = { | ||
winhl = { | ||
Visual = { bg = lighten(palette.pink, 0.3) }, | ||
}, | ||
}, | ||
R = { | ||
winhl = { | ||
CursorLine = { bg = lighten(palette.flamingo, 0.2) }, | ||
CursorLineNr = { bg = lighten(palette.flamingo, 0.2) }, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
local palette = require("catppuccin.palettes").get_palette "macchiato" | ||
local presets = require "catppuccin.utils.reactive" | ||
|
||
return presets.cursor("catppuccin-macchiato-cursor", palette) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
local palette = require("catppuccin.palettes").get_palette "macchiato" | ||
local presets = require "catppuccin.utils.reactive" | ||
local darken = require("catppuccin.utils.colors").darken | ||
|
||
local preset = presets.cursorline("catppuccin-macchiato-cursorline", palette) | ||
|
||
preset.static.winhl.inactive.CursorLine = { bg = darken(palette.surface0, 0.8) } | ||
preset.static.winhl.inactive.CursorLineNr = { bg = darken(palette.surface0, 0.8) } | ||
|
||
return preset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
local palette = require("catppuccin.palettes").get_palette "mocha" | ||
local presets = require "catppuccin.utils.reactive" | ||
|
||
return presets.cursor("catppuccin-mocha-cursor", palette) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
local palette = require("catppuccin.palettes").get_palette "mocha" | ||
local presets = require "catppuccin.utils.reactive" | ||
|
||
return presets.cursorline("catppuccin-mocha-cursorline", palette) |