general fixes plus nvim transparent

This commit is contained in:
2023-10-18 18:04:57 +02:00
parent 3ce2c4f098
commit df229f0856
6 changed files with 74 additions and 21 deletions

View File

@@ -1,9 +1,18 @@
{ inputs, pkgs, ... }:
{ inputs, pkgs, lib, ... }:
{
programs.neovim =
let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
fromGitHub = rev: ref: repo: pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName repo}";
version = ref;
src = builtins.fetchGit {
url = "https://github.com/${repo}.git";
ref = ref;
rev = rev;
};
};
in
{
enable = true;
@@ -14,31 +23,31 @@
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
plugins = with pkgs; [
# Colorschemes
{
plugin = catppuccin-nvim;
plugin = vimPlugins.catppuccin-nvim;
config = toLuaFile ./plugins/colorschemes/catppuccin.lua;
}
# LSP
{
plugin = nvim-lspconfig;
plugin = vimPlugins.nvim-lspconfig;
config = toLuaFile ./plugins/lsp.lua;
}
cmp-buffer
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lua
cmp-path
cmp_luasnip
luasnip
nvim-cmp
vimPlugins.cmp-buffer
vimPlugins.cmp-cmdline
vimPlugins.cmp-nvim-lsp
vimPlugins.cmp-nvim-lua
vimPlugins.cmp-path
vimPlugins.cmp_luasnip
vimPlugins.luasnip
vimPlugins.nvim-cmp
# The rest
{
plugin = indent-blankline-nvim;
plugin = vimPlugins.indent-blankline-nvim;
config = toLuaFile ./plugins/indent.lua;
}
@@ -46,22 +55,28 @@
# TODO: enable this when treesitter is installed
# {
# plugin = nvim-ts-autotag;
# plugin = vimPlugins.nvim-ts-autotag;
# config = toLuaFile ./plugins/autotag.lua;
# }
{
plugin = nvim-colorizer-lua;
plugin = vimPlugins.nvim-colorizer-lua;
config = toLuaFile ./plugins/colorizer.lua;
}
# GIT
{
plugin = gitsigns-nvim;
plugin = vimPlugins.gitsigns-nvim;
config = toLuaFile ./plugins/gitsigns.lua;
}
vim-fugitive
vimPlugins.vim-fugitive
{
plugin = (fromGitHub "3af6232c8d39d51062702e875ff6407c1eeb0391" "main" "xiyaowong/transparent.nvim");
config = toLuaFile ./plugins/transparent.lua
}
];

View File

@@ -0,0 +1,34 @@
local status, plugin = pcall(require, 'transparent')
if not status then
print('Plugin Error: ', plugin)
return
end
plugin.setup({
groups = { -- table: default groups
'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier',
'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
'SignColumn', 'CursorLineNr', 'EndOfBuffer',
},
extra_groups = {
"NormalFloat", -- plugins which have float panel such as Lazy, Mason, LspInfo
"NvimTreeNormal", -- NvimTree
"NvimTreeNormalNC",
"NvimTreeWinSeparator",
"TelescopeNormal",
"TelescopeBorder",
"WhichKeyFloat",
}, -- table: additional groups that should be cleared
exclude_groups = {}, -- table: groups you don't want to clear
})
vim.g.transparent_groups = vim.list_extend(
vim.g.transparent_groups or {},
vim.tbl_map(function(v)
return v.hl_group
end, vim.tbl_values(require('bufferline.config').highlights))
)
--- Fix for bufferline looking strange on startup ---
vim.cmd(":TransparentToggle")
vim.cmd(":TransparentToggle")