diff --git a/extra.nix b/extra.nix index e73face..4765bcf 100644 --- a/extra.nix +++ b/extra.nix @@ -93,7 +93,7 @@ inputs: let vim.autopairs.enable = true; vim.autocomplete = { - enable = false; + enable = true; type = "nvim-cmp"; }; diff --git a/modules/completion/nvim-cmp/nvim-cmp.nix b/modules/completion/nvim-cmp/nvim-cmp.nix index 77c677e..bb6f7f9 100644 --- a/modules/completion/nvim-cmp/nvim-cmp.nix +++ b/modules/completion/nvim-cmp/nvim-cmp.nix @@ -49,10 +49,13 @@ with builtins; { ''; type = types.str; default = "nvim_cmp_menu_map"; - example = '' + example = nvim.nmd.literalAsciiDoc '' + [source,lua] + --- function(entry, vim_item) return vim_item end + --- ''; }; }; diff --git a/modules/lsp/config.nix b/modules/lsp/config.nix index a90bd02..5e56b9c 100644 --- a/modules/lsp/config.nix +++ b/modules/lsp/config.nix @@ -12,7 +12,7 @@ in { config = mkIf cfg.enable { vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp"; - vim.autocomplete.sources = ["nvim_lsp"]; + vim.autocomplete.sources = {"nvim_lsp" = "[LSP]";}; vim.luaConfigRC.lsp-setup = '' vim.g.formatsave = ${boolToString cfg.formatOnSave}; diff --git a/modules/statusline/lualine/lualine.nix b/modules/statusline/lualine/lualine.nix index 5cd51e8..f1bd31c 100644 --- a/modules/statusline/lualine/lualine.nix +++ b/modules/statusline/lualine/lualine.nix @@ -42,46 +42,50 @@ in { default = true; }; - theme = mkOption { - description = "Theme for lualine"; - default = "auto"; - type = types.enum ( - [ - "auto" - "16color" - "gruvbox" - "ayu_dark" - "ayu_light" - "ayu_mirage" - "codedark" - "dracula" - "everforest" - "gruvbox" - "gruvbox_light" - "gruvbox_material" - "horizon" - "iceberg_dark" - "iceberg_light" - "jellybeans" - "material" - "modus_vivendi" - "molokai" - "nightfly" - "nord" - "oceanicnext" - "onelight" - "palenight" - "papercolor_dark" - "papercolor_light" - "powerline" - "seoul256" - "solarized_dark" - "tomorrow" - "wombat" - ] - ++ optional (elem config.vim.theme.name supported_themes) config.vim.theme.name - ); - }; + theme = let + themeSupported = elem config.vim.theme.name supported_themes; + in + mkOption { + description = "Theme for lualine"; + type = types.enum ([ + "auto" + "16color" + "gruvbox" + "ayu_dark" + "ayu_light" + "ayu_mirage" + "codedark" + "dracula" + "everforest" + "gruvbox" + "gruvbox_light" + "gruvbox_material" + "horizon" + "iceberg_dark" + "iceberg_light" + "jellybeans" + "material" + "modus_vivendi" + "molokai" + "nightfly" + "nord" + "oceanicnext" + "onelight" + "palenight" + "papercolor_dark" + "papercolor_light" + "powerline" + "seoul256" + "solarized_dark" + "tomorrow" + "wombat" + ] + ++ optional themeSupported config.vim.theme.name); + default = "auto"; + # TODO: xml generation error if the closing '' is on a new line. + # issue: https://gitlab.com/rycee/nmd/-/issues/10 + defaultText = nvim.nmd.literalAsciiDoc ''`config.vim.theme.name` if theme supports lualine else "auto"''; + }; sectionSeparator = { left = mkOption { diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index b1794c1..4981961 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -4,7 +4,9 @@ ... }: with lib; -with builtins; { +with builtins; let + cfg = config.vim.visuals; +in { options.vim.visuals = { enable = mkEnableOption "Visual enhancements.";