1

Regenerate nvim config

This commit is contained in:
2024-06-02 03:29:20 +02:00
parent 75eea0c030
commit ef2e28883d
5576 changed files with 604886 additions and 503 deletions

View File

@ -0,0 +1,104 @@
local function reload()
for name, _ in pairs(package.loaded) do
if name:match "^catppuccin" then package.loaded[name] = nil end
end
vim.g.catppuccin_flavour = nil
vim.cmd [[highlight clear]]
end
describe("set background to", function()
before_each(function()
reload()
vim.cmd.colorscheme "catppuccin"
end)
it("light", function()
vim.o.background = "light"
assert.equals("catppuccin-latte", vim.g.colors_name)
end)
it("dark", function()
vim.o.background = "dark"
assert.equals("catppuccin-mocha", vim.g.colors_name)
end)
end)
describe("respect vim.o.background =", function()
before_each(function() reload() end)
it("light", function()
vim.o.background = "light"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-latte", vim.g.colors_name)
end)
it("dark", function()
vim.o.background = "dark"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-mocha", vim.g.colors_name)
end)
end)
describe("change flavour to", function()
before_each(function() reload() end)
it("latte", function()
vim.cmd.colorscheme "catppuccin-latte"
assert.equals("catppuccin-latte", vim.g.colors_name)
end)
it("frappe", function()
vim.cmd.colorscheme "catppuccin-frappe"
assert.equals("catppuccin-frappe", vim.g.colors_name)
end)
it("macchiato", function()
vim.cmd.colorscheme "catppuccin-macchiato"
assert.equals("catppuccin-macchiato", vim.g.colors_name)
end)
it("mocha", function()
vim.cmd.colorscheme "catppuccin-mocha"
assert.equals("catppuccin-mocha", vim.g.colors_name)
end)
end)
describe("respect setup flavour =", function()
before_each(function() reload() end)
it("latte", function()
require("catppuccin").setup { flavour = "latte" }
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-latte", vim.g.colors_name)
end)
it("frappe", function()
require("catppuccin").setup { flavour = "frappe" }
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-frappe", vim.g.colors_name)
end)
it("macchiato", function()
require("catppuccin").setup { flavour = "macchiato" }
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-macchiato", vim.g.colors_name)
end)
it("mocha", function()
require("catppuccin").setup { flavour = "mocha" }
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-mocha", vim.g.colors_name)
end)
end)
describe("(deprecated) respect vim.g.catppuccin_flavour =", function()
before_each(function() reload() end)
it("latte", function()
vim.g.catppuccin_flavour = "latte"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-latte", vim.g.colors_name)
end)
it("frappe", function()
vim.g.catppuccin_flavour = "frappe"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-frappe", vim.g.colors_name)
end)
it("macchiato", function()
vim.g.catppuccin_flavour = "macchiato"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-macchiato", vim.g.colors_name)
end)
it("mocha", function()
vim.g.catppuccin_flavour = "mocha"
vim.cmd.colorscheme "catppuccin"
assert.equals("catppuccin-mocha", vim.g.colors_name)
end)
end)

View File

@ -0,0 +1,41 @@
describe("hash", function()
local hash = require("catppuccin.lib.hashing").hash
it("typo", function() assert.are_not.equals(hash { custom_highlight = {} }, hash { ustom_highlight = {} }) end)
it(
"when table order is shuffled",
function()
assert.equals(
hash {
custom_highlight = {
Search = { fg = "#F5C2E7", bg = "#45475A", style = { "bold" } },
IncSearch = { fg = "#45475A", bg = "#F5C2E7" },
},
},
hash {
custom_highlight = {
Search = { style = { "bold" }, bg = "#45475A", fg = "#F5C2E7" },
IncSearch = { bg = "#F5C2E7", fg = "#45475A" },
},
}
)
end
)
it(
"when toggle true/false",
function()
assert.are_not.equals({
integrations = {
navic = true,
noice = true,
fidget = true,
},
}, {
integrations = {
navic = true,
noice = false,
fidget = false,
},
})
end
)
end)

View File

@ -0,0 +1,27 @@
local status, error = pcall(function()
local root = vim.fn.fnamemodify(".repro", ":p")
for _, name in ipairs { "config", "data", "state", "cache" } do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup({
{ "catppuccin/nvim", dev = true },
}, {
root = root .. "/plugins",
dev = {
path = debug.getinfo(1).source:sub(2, -21),
},
})
require("catppuccin").setup()
vim.cmd.colorscheme "catppuccin"
end)
if error then print(error) end
vim.cmd(status and "0cq" or "1cq")

View File

@ -0,0 +1,13 @@
try
call plug#begin()
Plug expand('<sfile>')[0:-16]
call plug#end()
lua require("catppuccin").setup {}
colorscheme catppuccin
catch
echo v:exception
1cq
finally
0cq
endtry

View File

@ -0,0 +1,3 @@
set rtp+=.
runtime! plugin/plenary.vim

View File

@ -0,0 +1,19 @@
local function reload()
for name, _ in pairs(package.loaded) do
if name:match "^catppuccin" then package.loaded[name] = nil end
end
vim.g.catppuccin_flavour = nil
vim.cmd [[highlight clear]]
end
-- TODO: Move this to setup_spec
describe("get palette", function()
before_each(function() reload() end)
it("before setup", function()
assert.equals(pcall(function() require("catppuccin.palettes").get_palette() end), true)
end)
it("after setup", function()
require("catppuccin").setup()
assert.equals(pcall(function() require("catppuccin.palettes").get_palette() end), true)
end)
end)