From f44000e5189346e2e5f4c868662b405139840c68 Mon Sep 17 00:00:00 2001 From: Roel de Cort <63876068+dc-tec@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:56:19 +0200 Subject: [PATCH] patch: mix fixes (#33) - During build time multiple warnings were shown about the deprecation of certain options. These have been moved to their new places. - Disable the CMP Ghost Text option because it was driving me nuts. --- config/plugins/cmp/cmp.nix | 2 +- config/plugins/editor/navic.nix | 66 ++++---- config/plugins/ui/lualine.nix | 186 +++++++++++----------- config/plugins/utils/markdown-preview.nix | 6 +- 4 files changed, 133 insertions(+), 127 deletions(-) diff --git a/config/plugins/cmp/cmp.nix b/config/plugins/cmp/cmp.nix index 518643d..2609303 100644 --- a/config/plugins/cmp/cmp.nix +++ b/config/plugins/cmp/cmp.nix @@ -5,7 +5,7 @@ enable = true; settings = { autoEnableSources = true; - experimental = {ghost_text = true;}; + experimental = {ghost_text = false;}; performance = { debounce = 60; fetchingTimeout = 200; diff --git a/config/plugins/editor/navic.nix b/config/plugins/editor/navic.nix index dfdd5c9..4fd2d11 100644 --- a/config/plugins/editor/navic.nix +++ b/config/plugins/editor/navic.nix @@ -1,38 +1,40 @@ _: { plugins.navic = { enable = true; - separator = "  "; - highlight = true; - depthLimit = 5; - lsp = { - autoAttach = true; - }; - icons = { - Array = "󱃵 "; - Boolean = " "; - Class = " "; - Constant = " "; - Constructor = " "; - Enum = " "; - EnumMember = " "; - Event = " "; - Field = "󰽏 "; - File = " "; - Function = "󰡱 "; - Interface = " "; - Key = " "; - Method = " "; - Module = "󰕳 "; - Namespace = " "; - Null = "󰟢 "; - Number = " "; - Object = " "; - Operator = " "; - Package = "󰏖 "; - String = " "; - Struct = " "; - TypeParameter = " "; - Variable = " "; + settings = { + separator = "  "; + highlight = true; + depthLimit = 5; + lsp = { + autoAttach = true; + }; + icons = { + Array = "󱃵 "; + Boolean = " "; + Class = " "; + Constant = " "; + Constructor = " "; + Enum = " "; + EnumMember = " "; + Event = " "; + Field = "󰽏 "; + File = " "; + Function = "󰡱 "; + Interface = " "; + Key = " "; + Method = " "; + Module = "󰕳 "; + Namespace = " "; + Null = "󰟢 "; + Number = " "; + Object = " "; + Operator = " "; + Package = "󰏖 "; + String = " "; + Struct = " "; + TypeParameter = " "; + Variable = " "; + }; }; }; } diff --git a/config/plugins/ui/lualine.nix b/config/plugins/ui/lualine.nix index eef1c66..bb74a6e 100644 --- a/config/plugins/ui/lualine.nix +++ b/config/plugins/ui/lualine.nix @@ -1,98 +1,102 @@ _: { plugins.lualine = { enable = true; - globalstatus = true; - extensions = [ - "fzf" - "neo-tree" - ]; - disabledFiletypes = { - statusline = ["startup" "alpha"]; - }; - theme = "catppuccin"; - sections = { - lualine_a = [ - { - name = "mode"; - icon = " "; - } - ]; - lualine_b = [ - { - name = "branch"; - icon = ""; - } - { - name = "diff"; - extraConfig = { - symbols = { - added = " "; - modified = " "; - removed = " "; - }; - }; - } - ]; - lualine_c = [ - { - name = "diagnostics"; - extraConfig = { - sources = ["nvim_lsp"]; - symbols = { - error = " "; - warn = " "; - info = " "; - hint = "󰝶 "; - }; - }; - } - { - name = "navic"; - } - ]; - lualine_x = [ - { - name = "filetype"; - extraConfig = { - icon_only = true; - separator = ""; - padding = { - left = 1; - right = 0; - }; - }; - } - { - name = "filename"; - extraConfig = { - path = 1; - }; - } - { - name.__raw = '' - function() - local icon = " " - local status = require("copilot.api").status.data - return icon .. (status.message or " ") - end, + settings = { + options = { + globalstatus = true; + extensions = [ + "fzf" + "neo-tree" + ]; + disabledFiletypes = { + statusline = ["startup" "alpha"]; + }; + theme = "catppuccin"; + sections = { + lualine_a = [ + { + name = "mode"; + icon = " "; + } + ]; + lualine_b = [ + { + name = "branch"; + icon = ""; + } + { + name = "diff"; + extraConfig = { + symbols = { + added = " "; + modified = " "; + removed = " "; + }; + }; + } + ]; + lualine_c = [ + { + name = "diagnostics"; + extraConfig = { + sources = ["nvim_lsp"]; + symbols = { + error = " "; + warn = " "; + info = " "; + hint = "󰝶 "; + }; + }; + } + { + name = "navic"; + } + ]; + lualine_x = [ + { + name = "filetype"; + extraConfig = { + icon_only = true; + separator = ""; + padding = { + left = 1; + right = 0; + }; + }; + } + { + name = "filename"; + extraConfig = { + path = 1; + }; + } + { + name.__raw = '' + function() + local icon = " " + local status = require("copilot.api").status.data + return icon .. (status.message or " ") + end, - cond = function() - local ok, clients = pcall(vim.lsp.get_clients, { name = "copilot", bufnr = 0 }) - return ok and #clients > 0 - end, - ''; - } - ]; - lualine_y = [ - { - name = "progress"; - } - ]; - lualine_z = [ - { - name = "location"; - } - ]; + cond = function() + local ok, clients = pcall(vim.lsp.get_clients, { name = "copilot", bufnr = 0 }) + return ok and #clients > 0 + end, + ''; + } + ]; + lualine_y = [ + { + name = "progress"; + } + ]; + lualine_z = [ + { + name = "location"; + } + ]; + }; + }; }; }; } diff --git a/config/plugins/utils/markdown-preview.nix b/config/plugins/utils/markdown-preview.nix index 93bc9d0..70dfc03 100644 --- a/config/plugins/utils/markdown-preview.nix +++ b/config/plugins/utils/markdown-preview.nix @@ -4,11 +4,11 @@ _: { enable = true; settings = { browser = "firefox"; - echo_preview_url = true; + echo_preview_url = 1; port = "6969"; preview_options = { - disable_filename = true; - disable_sync_scroll = true; + disable_filename = 1; + disable_sync_scroll = 1; sync_scroll_type = "middle"; }; theme = "dark";