Nvim : Cleanup schemes + use custom generator.

This commit is contained in:
Dmitry Voronin 2024-10-10 02:42:51 +03:00
parent 8db6f1ad05
commit 5476267bf5
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
6 changed files with 18 additions and 111 deletions

View file

@ -673,38 +673,6 @@
"type": "github" "type": "github"
} }
}, },
"nvimTokyonight": {
"flake": false,
"locked": {
"lastModified": 1727855599,
"narHash": "sha256-pnsx3e/s41+TRIW1Nv7hQA4Erq4209RAjw3nxXaiia4=",
"owner": "folke",
"repo": "tokyonight.nvim",
"rev": "efd1417aa01af618426fe1cf507c5458090458f2",
"type": "github"
},
"original": {
"owner": "folke",
"repo": "tokyonight.nvim",
"type": "github"
}
},
"nvimTransparent": {
"flake": false,
"locked": {
"lastModified": 1724573095,
"narHash": "sha256-6jOLgcWqnVzabT2+CehY92Z4mYzJHiRiInn5T5OXqZE=",
"owner": "xiyaowong",
"repo": "transparent.nvim",
"rev": "8a2749a2fa74f97fe6557f61b89ac7fd873f3c21",
"type": "github"
},
"original": {
"owner": "xiyaowong",
"repo": "transparent.nvim",
"type": "github"
}
},
"nvimTree": { "nvimTree": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -798,8 +766,6 @@
"nvimPlenary": "nvimPlenary", "nvimPlenary": "nvimPlenary",
"nvimTelescope": "nvimTelescope", "nvimTelescope": "nvimTelescope",
"nvimTodo": "nvimTodo", "nvimTodo": "nvimTodo",
"nvimTokyonight": "nvimTokyonight",
"nvimTransparent": "nvimTransparent",
"nvimTree": "nvimTree", "nvimTree": "nvimTree",
"nvimTreesitter": "nvimTreesitter", "nvimTreesitter": "nvimTreesitter",
"nvimTrouble": "nvimTrouble", "nvimTrouble": "nvimTrouble",

View file

@ -98,14 +98,6 @@
url = "github:folke/todo-comments.nvim"; url = "github:folke/todo-comments.nvim";
flake = false; flake = false;
}; };
nvimTokyonight = {
url = "github:folke/tokyonight.nvim";
flake = false;
};
nvimTransparent = {
url = "github:xiyaowong/transparent.nvim";
flake = false;
};
nvimTree = { nvimTree = {
url = "github:nvim-tree/nvim-tree.lua"; url = "github:nvim-tree/nvim-tree.lua";
flake = false; flake = false;

View file

@ -31,8 +31,6 @@ in {
"${inputs.nvimPlenary}" "${inputs.nvimPlenary}"
"${inputs.nvimTelescope}" "${inputs.nvimTelescope}"
"${inputs.nvimTodo}" "${inputs.nvimTodo}"
"${inputs.nvimTokyonight}"
"${inputs.nvimTransparent}"
"${inputs.nvimTreesitter}" "${inputs.nvimTreesitter}"
"${inputs.nvimTree}" "${inputs.nvimTree}"
"${inputs.nvimTrouble}" "${inputs.nvimTrouble}"
@ -52,7 +50,6 @@ in {
./module/plugin/Autoclose.nix ./module/plugin/Autoclose.nix
./module/plugin/Gitsigns.nix ./module/plugin/Gitsigns.nix
./module/plugin/Trouble.nix ./module/plugin/Trouble.nix
./module/plugin/Tokyonight.nix
./module/plugin/Closebuffers.nix ./module/plugin/Closebuffers.nix
./module/plugin/Telescope.nix ./module/plugin/Telescope.nix
./module/plugin/Todo.nix ./module/plugin/Todo.nix
@ -62,7 +59,6 @@ in {
./module/plugin/Fold.nix ./module/plugin/Fold.nix
./module/plugin/Ollama.nix ./module/plugin/Ollama.nix
./module/plugin/Colorizer.nix ./module/plugin/Colorizer.nix
./module/plugin/Transparent.nix
./module/plugin/lsp/Haskell.nix ./module/plugin/lsp/Haskell.nix
./module/plugin/lsp/Rust.nix ./module/plugin/lsp/Rust.nix
./module/plugin/lsp/Tex.nix ./module/plugin/lsp/Tex.nix

View file

@ -1,16 +1,24 @@
{ config, ... }: let { config, lib, ... }: let
cfg = config.style.color; color = config.style.color;
bg = cfg.bg.regular; mkHighlight = name: value: ''vim.api.nvim_set_hl(0, "${name}", ${lib.generators.toLua { multiline = false; asBindings = false; } value})'';
selection = { bg = "#${color.bg.regular}"; };
transparent = { bg = lib.generators.mkLuaInline "clear"; };
in { in {
# TODO: Create a function to set group color.
text = '' text = ''
vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, { vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, {
group = vim.api.nvim_create_augroup('Color', {}), group = vim.api.nvim_create_augroup('Color', {}),
pattern = "*", pattern = "*",
callback = function () callback = function ()
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#${bg}" }) -- Selection.
${mkHighlight "CursorLine" selection}
${mkHighlight "Visual" selection}
${mkHighlight "TelescopeSelection" selection}
-- Transparent.
${mkHighlight "NormalFloat" transparent}
end end
}) })
''; '';
} }

View file

@ -1,27 +0,0 @@
{ ... }: {
text = ''
require("tokyonight").setup({
light_style = "night",
style = "night",
terminal_colors = true,
transparent = false,
styles = {
comments = { italic = true },
floats = "dark",
functions = {},
keywords = { italic = true },
sidebars = "dark",
variables = {},
},
day_brightness = 0.3,
dim_inactive = false,
hide_inactive_statusline = false,
lualine_bold = false,
on_colors = function(colors) end,
on_highlights = function(highlights, colors) end,
sidebars = { "qf", "help" },
})
-- vim.cmd[[colorscheme tokyonight]]
'';
}

View file

@ -1,28 +0,0 @@
{ ... }: {
text = ''
vim.g.transparent_enabled = true
-- Optional, you don't have to run setup.
require("transparent").setup({
-- table: default groups
-- groups = {
-- 'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier',
-- 'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
-- 'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
-- 'SignColumn', 'CursorLine', 'CursorLineNr', 'StatusLine', 'StatusLineNC',
-- 'EndOfBuffer',
-- },
-- table: additional groups that should be cleared
extra_groups = {
'NormalFloat',
},
-- table: groups you don't want to clear
exclude_groups = {
'CursorLine',
},
-- function: code to be executed after highlight groups are cleared
-- Also the user event "TransparentClear" will be triggered
on_clear = function() end,
})
'';
}