From 5257808e5cee1d57870237a8e8ebc5861a88a224 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 21 Oct 2024 14:57:32 -0300 Subject: [PATCH 1/5] feat(neovim): move from catppuccin-frappe to a base16 catppuccin theme --- .../colors/catppuccin-frappe-base16.lua | 22 +++++++++++++++++++ .../home-manager/programs/neovim/default.nix | 2 ++ .../programs/neovim/lua/community.lua | 1 + .../programs/neovim/lua/plugins/astroui.lua | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua diff --git a/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua b/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua new file mode 100644 index 0000000..505f9f4 --- /dev/null +++ b/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua @@ -0,0 +1,22 @@ +require("mini.base16").setup({ + palette = { + base00 = "#303446", -- base + base01 = "#292c3c", -- mantle + base02 = "#414559", -- surface0 + base03 = "#51576d", -- surface1 + base04 = "#626880", -- surface2 + base05 = "#c6d0f5", -- text + base06 = "#f2d5cf", -- rosewater + base07 = "#babbf1", -- lavender + base08 = "#e78284", -- red + base09 = "#ef9f76", -- peach + base0A = "#e5c890", -- yellow + base0B = "#a6d189", -- green + base0C = "#81c8be", -- teal + base0D = "#8caaee", -- blue + base0E = "#ca9ee6", -- mauve + base0F = "#eebebe", -- flamingo + }, +}) + +vim.g.colors_name = "catppuccin-frappe-base16" diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index 5f7cf53..ead6e7a 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -113,5 +113,7 @@ in config = config; pkgs = pkgs; }; + + xdg.configFile."nvim/colors/catppuccin-frappe-base16.lua".source = ./colors/catppuccin-frappe-base16.lua; }; } diff --git a/modules/home-manager/programs/neovim/lua/community.lua b/modules/home-manager/programs/neovim/lua/community.lua index 4a34756..2302493 100644 --- a/modules/home-manager/programs/neovim/lua/community.lua +++ b/modules/home-manager/programs/neovim/lua/community.lua @@ -14,6 +14,7 @@ return { config.transparent_background = true end, }, + { import = "astrocommunity.colorscheme.mini-base16" }, { import = "astrocommunity.editing-support.todo-comments-nvim" }, { import = "astrocommunity.editing-support.zen-mode-nvim" }, diff --git a/modules/home-manager/programs/neovim/lua/plugins/astroui.lua b/modules/home-manager/programs/neovim/lua/plugins/astroui.lua index b061470..135a79c 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/astroui.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/astroui.lua @@ -9,7 +9,7 @@ return { ---@type AstroUIOpts opts = { -- change colorscheme - colorscheme = "catppuccin", + colorscheme = "catppuccin-frappe-base16", -- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes highlights = { init = { -- this table overrides highlights in all themes From 753913e67d9ac38d0b730de081586a43ea955e55 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 21 Oct 2024 14:58:04 -0300 Subject: [PATCH 2/5] feat(neovim): add transparency.nvim with many tweaks --- .../programs/neovim/lua/plugins/user.lua | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/modules/home-manager/programs/neovim/lua/plugins/user.lua b/modules/home-manager/programs/neovim/lua/plugins/user.lua index 4633bca..61038b8 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/user.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/user.lua @@ -26,6 +26,74 @@ return { end, }, + -- Makes most if not all groups have a transparent background. + { + "xiyaowong/transparent.nvim", + opts = function(_, opts) + opts.groups = { + "Comment", + "Conditional", + "Constant", + "CursorLine", + "CursorLineNr", + "EndOfBuffer", + "Function", + "Identifier", + "LineNr", + "NonText", + "Normal", + "NormalNC", + "Operator", + "PreProc", + "Repeat", + "SignColumn", + "Special", + "Statement", + -- "StatusLine", + -- "StatusLineNC", + "String", + "Structure", + "Todo", + "Type", + "Underlined", + } + + opts.extra_groups = { + "CursorColumn", + "CursorLineFold", + "CursorLineSign", + "DiagnosticSignError", + "DiagnosticSignHint", + "DiagnosticSignInfo", + "DiagnosticSignOk", + "DiagnosticSignWarn", + "FloatBorder", + "FoldColumn", + "Folded", + "GitSignsAdd", + "GitSignsChange", + "GitSignsDelete", + "LineNr", + "LineNrAbove", + "LineNrBelow", + "LineNrBelow", + "NeoTreeFloatBoarder", + "NeoTreeMessage", + "NeoTreeNormal", + "NeoTreeTabSeparatorActive", + "NeoTreeTabSeparatorInactive", + "NeoTreeVertSplit", + "NeoTreeWinSeparator", + "TabLine", + "TabLineFill", + "VertSplit", + "WinBar", + "WinBarNC", + "WinSeparator", + } + end, + }, + -- Adds highlighting and lsp features for embedded code in documents. { "jmbuhr/otter.nvim", From bc5635c1f5b846d08d2b9057dc278445b9d0dc5a Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 21 Oct 2024 14:59:17 -0300 Subject: [PATCH 3/5] feat(neovim): drop prettierd in favor of deno fmt --- .../home-manager/programs/neovim/default.nix | 4 +-- .../programs/neovim/lua/plugins/none-ls.lua | 31 ++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index ead6e7a..c3838ab 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -74,7 +74,6 @@ in # Markdown markdownlint-cli marksman - prettierd # Nix nixd @@ -85,7 +84,8 @@ in python312Packages.flake8 ruff - # TypeScript + # TypeScript/JavaScript + deno typescript-language-server # Rust diff --git a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua index 3f13da4..824f270 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua @@ -9,6 +9,35 @@ return { opts = function(_, config) -- config variable is the default configuration table for the setup function call local null_ls = require("null-ls") + local helpers = require("null-ls.helpers") + + local deno_fmt = helpers.make_builtin({ + name = "deno_fmt", + filetypes = { + "angular", + "astro", + "css", + "html", + "javascript", + "json", + "jsonc", + "less", + "markdown", + "sass", + "scss", + "svelte", + "typescript", + "vue", + "yaml", + }, + method = { null_ls.methods.FORMATTING }, + generator_opts = { + command = "deno", + args = { "fmt", "--unstable-component", "-" }, + to_stdin = true, + }, + factory = helpers.formatter_factory, + }) -- Check supported formatters and linters -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting @@ -20,8 +49,8 @@ return { null_ls.builtins.formatting.clang_format, null_ls.builtins.formatting.csharpier, null_ls.builtins.formatting.nixfmt, - null_ls.builtins.formatting.prettier, null_ls.builtins.formatting.stylua, + deno_fmt, } return config -- return final config table end, From fe1c913ad8ceea8c31790925b0c69afbfa550d36 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 21 Oct 2024 14:59:25 -0300 Subject: [PATCH 4/5] fix(neovim): missing packages --- modules/home-manager/programs/neovim/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index c3838ab..b96e0d6 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -87,11 +87,12 @@ in # TypeScript/JavaScript deno typescript-language-server + vscode-js-debug # Rust rust-analyzer taplo - vscode-extensions.vadimcn.vscode-lldb.adapter + vscode-extensions.vadimcn.vscode-lldb # Vue vue-language-server From 0c401df0adc818f9dcdb99d47c4bd0d68726ac9c Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 22 Oct 2024 18:53:35 -0300 Subject: [PATCH 5/5] feat(neovim): theme touch ups --- .../colors/catppuccin-frappe-base16.lua | 68 ++++++++++++++----- .../programs/neovim/lua/plugins/user.lua | 13 ++-- 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua b/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua index 505f9f4..98be7b7 100644 --- a/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua +++ b/modules/home-manager/programs/neovim/colors/catppuccin-frappe-base16.lua @@ -1,22 +1,54 @@ +local colors = { + base00 = "#303446", -- base + base01 = "#292c3c", -- mantle + base02 = "#414559", -- surface0 + base03 = "#51576d", -- surface1 + base04 = "#626880", -- surface2 + base05 = "#c6d0f5", -- text + base06 = "#f2d5cf", -- rosewater + base07 = "#babbf1", -- lavender + base08 = "#e78284", -- red + base09 = "#ef9f76", -- peach + base0A = "#e5c890", -- yellow + base0B = "#a6d189", -- green + base0C = "#81c8be", -- teal + base0D = "#8caaee", -- blue + base0E = "#ca9ee6", -- mauve + base0F = "#eebebe", -- flamingo +} + require("mini.base16").setup({ - palette = { - base00 = "#303446", -- base - base01 = "#292c3c", -- mantle - base02 = "#414559", -- surface0 - base03 = "#51576d", -- surface1 - base04 = "#626880", -- surface2 - base05 = "#c6d0f5", -- text - base06 = "#f2d5cf", -- rosewater - base07 = "#babbf1", -- lavender - base08 = "#e78284", -- red - base09 = "#ef9f76", -- peach - base0A = "#e5c890", -- yellow - base0B = "#a6d189", -- green - base0C = "#81c8be", -- teal - base0D = "#8caaee", -- blue - base0E = "#ca9ee6", -- mauve - base0F = "#eebebe", -- flamingo - }, + palette = colors, }) vim.g.colors_name = "catppuccin-frappe-base16" + +local function hl(highlight, options) + vim.api.nvim_set_hl(0, highlight, options) +end + +local function fg(color) + return { fg = color, bg = nil, attr = nil, sp = nil } +end + +---------------------------- +-- Further customizations -- +---------------------------- + +-- General +hl("Delimiter", fg(colors.base05)) +hl("Tag", fg(colors.base08)) + +-- Treesitter +hl("@keyword.return", fg(colors.base0E)) +hl("@variable", fg(colors.base08)) + +-- Tags +hl("@tag.attribute", fg(colors.base09)) +hl("@tag.delimiter", fg(colors.base05)) + +-- LSP Semantic Highlight +hl("@lsp.mod.deprecated", fg(colors.base0F)) +hl("@lsp.type.parameter", fg(colors.base05)) +hl("@lsp.type.property", fg(colors.base05)) +hl("@lsp.type.variable", fg(colors.base08)) diff --git a/modules/home-manager/programs/neovim/lua/plugins/user.lua b/modules/home-manager/programs/neovim/lua/plugins/user.lua index 61038b8..e405499 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/user.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/user.lua @@ -30,6 +30,8 @@ return { { "xiyaowong/transparent.nvim", opts = function(_, opts) + local transparent = require("transparent") + opts.groups = { "Comment", "Conditional", @@ -77,13 +79,7 @@ return { "LineNrAbove", "LineNrBelow", "LineNrBelow", - "NeoTreeFloatBoarder", - "NeoTreeMessage", - "NeoTreeNormal", - "NeoTreeTabSeparatorActive", - "NeoTreeTabSeparatorInactive", - "NeoTreeVertSplit", - "NeoTreeWinSeparator", + "NvimTreeWindowPicker", "TabLine", "TabLineFill", "VertSplit", @@ -91,6 +87,9 @@ return { "WinBarNC", "WinSeparator", } + + transparent.clear_prefix("BufferLine") + transparent.clear_prefix("NeoTree") end, },