diff --git a/plugins/completion/cmp/options/settings-options.nix b/plugins/completion/cmp/options/settings-options.nix index 1f78d191..cd422817 100644 --- a/plugins/completion/cmp/options/settings-options.nix +++ b/plugins/completion/cmp/options/settings-options.nix @@ -117,7 +117,7 @@ with lib; autocomplete = helpers.defaultNullOpts.mkNullable (with helpers.nixvimTypes; either (enum [ false ]) (listOf strLua)) - ''["require('cmp.types').cmp.TriggerEvent.TextChanged"]'' + [ "require('cmp.types').cmp.TriggerEvent.TextChanged" ] '' The event to trigger autocompletion. If set to `false`, then completion is only invoked manually (e.g. by calling `cmp.complete`). @@ -148,9 +148,16 @@ with lib; Boolean to show the `~` expandable indicator in cmp's floating window. ''; - fields = helpers.defaultNullOpts.mkListOf types.str ''["abbr" "kind" "menu"]'' '' - An array of completion fields to specify their order. - ''; + fields = + helpers.defaultNullOpts.mkListOf types.str + [ + "abbr" + "kind" + "menu" + ] + '' + An array of completion fields to specify their order. + ''; format = helpers.defaultNullOpts.mkLuaFn @@ -234,12 +241,10 @@ with lib; view = { entries = helpers.defaultNullOpts.mkNullable (with types; either str (attrsOf anything)) - '' - { - name = "custom"; - selection_order = "top_down"; - } - '' + { + name = "custom"; + selection_order = "top_down"; + } '' The view class used to customize nvim-cmp's appearance. ''; @@ -267,9 +272,7 @@ with lib; in { completion = { - border = - helpers.defaultNullOpts.mkBorder ''[ "" "" "" "" "" "" "" "" ]'' "nvim-cmp completion popup menu" - ""; + border = helpers.defaultNullOpts.mkBorder (genList (_: "") 8) "nvim-cmp completion popup menu" ""; winhighlight = mkWinhighlightOption "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None"; @@ -294,10 +297,9 @@ with lib; }; documentation = { - border = - helpers.defaultNullOpts.mkBorder ''[ "" "" "" " " "" "" "" " " ]'' - "nvim-cmp documentation popup menu" - ""; + border = helpers.defaultNullOpts.mkBorder (genList ( + _: "" + ) 8) "nvim-cmp documentation popup menu" ""; winhighlight = mkWinhighlightOption "FloatBorder:NormalFloat"; diff --git a/plugins/completion/cmp/sources/codeium-nvim.nix b/plugins/completion/cmp/sources/codeium-nvim.nix index 71bc75b9..1b274d75 100644 --- a/plugins/completion/cmp/sources/codeium-nvim.nix +++ b/plugins/completion/cmp/sources/codeium-nvim.nix @@ -15,9 +15,13 @@ in options.plugins.codeium-nvim = helpers.neovim-plugin.extraOptionsOptions // { package = helpers.mkPluginPackageOption "codeium.nvim" pkgs.vimPlugins.codeium-nvim; - configPath = helpers.defaultNullOpts.mkStr ''{__raw = "vim.fn.stdpath('cache') .. '/codeium/config.json'";}'' "The path to the config file, used to store the API key."; + configPath = helpers.defaultNullOpts.mkStr { + __raw = "vim.fn.stdpath('cache') .. '/codeium/config.json'"; + } "The path to the config file, used to store the API key."; - binPath = helpers.defaultNullOpts.mkStr ''{__raw = "vim.fn.stdpath('cache') .. '/codeium/bin'";}'' "The path to the directory where the Codeium server will be downloaded to."; + binPath = helpers.defaultNullOpts.mkStr { + __raw = "vim.fn.stdpath('cache') .. '/codeium/bin'"; + } "The path to the directory where the Codeium server will be downloaded to."; api = { host = helpers.defaultNullOpts.mkStr "server.codeium.com" '' diff --git a/plugins/completion/cmp/sources/copilot-cmp.nix b/plugins/completion/cmp/sources/copilot-cmp.nix index 52fd0694..157e7fd3 100644 --- a/plugins/completion/cmp/sources/copilot-cmp.nix +++ b/plugins/completion/cmp/sources/copilot-cmp.nix @@ -12,7 +12,11 @@ in { options.plugins.copilot-cmp = helpers.neovim-plugin.extraOptionsOptions // { event = - helpers.defaultNullOpts.mkNullable (with types; listOf str) ''["InsertEnter" "LspAttach"]'' + helpers.defaultNullOpts.mkListOf types.str + [ + "InsertEnter" + "LspAttach" + ] '' Configures when the source is registered. Unless you have a unique problem for your particular configuration you probably don't want diff --git a/plugins/completion/codeium-vim.nix b/plugins/completion/codeium-vim.nix index ea5f34cc..aa1d784f 100644 --- a/plugins/completion/codeium-vim.nix +++ b/plugins/completion/codeium-vim.nix @@ -65,14 +65,12 @@ helpers.vim-plugin.mkVimPlugin config { filetypes = helpers.defaultNullOpts.mkAttrsOf types.bool - '' - { - help = false; - gitcommit = false; - gitrebase = false; - "." = false; - } - '' + { + help = false; + gitcommit = false; + gitrebase = false; + "." = false; + } '' A dictionary mapping whether codeium should be enabled or disabled in certain filetypes. This can be used to opt out of completions for certain filetypes. diff --git a/plugins/completion/copilot-lua.nix b/plugins/completion/copilot-lua.nix index f08327e9..f8eb0b68 100644 --- a/plugins/completion/copilot-lua.nix +++ b/plugins/completion/copilot-lua.nix @@ -40,19 +40,18 @@ in layout = { position = - helpers.defaultNullOpts.mkEnum + helpers.defaultNullOpts.mkEnumFirstDefault [ "bottom" "top" "left" "right" ] - "bottom" '' The panel position. ''; - ratio = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.4" '' + ratio = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.4 '' The panel ratio. ''; }; @@ -68,9 +67,9 @@ in keymap = { accept = keymapOption "" "Keymap for accepting the suggestion."; - acceptWord = keymapOption "false" "Keymap for accepting a word suggestion."; + acceptWord = keymapOption false "Keymap for accepting a word suggestion."; - acceptLine = keymapOption "false" "Keymap for accepting a line suggestion."; + acceptLine = keymapOption false "Keymap for accepting a line suggestion."; next = keymapOption "" "Keymap for accepting the next suggestion."; @@ -81,20 +80,18 @@ in }; filetypes = - helpers.defaultNullOpts.mkNullable (with types; attrsOf (either bool helpers.nixvimTypes.rawLua)) - '' - { - yaml = false; - markdown = false; - help = false; - gitcommit = false; - gitrebase = false; - hgcommit = false; - svn = false; - cvs = false; - "." = false; - } - '' + helpers.defaultNullOpts.mkAttrsOf types.bool + { + yaml = false; + markdown = false; + help = false; + gitcommit = false; + gitrebase = false; + hgcommit = false; + svn = false; + cvs = false; + "." = false; + } '' Specify filetypes for attaching copilot. Each value can be either a boolean or a lua function that returns a boolean. @@ -137,30 +134,30 @@ in ''; }; - serverOptsOverrides = helpers.defaultNullOpts.mkNullable types.attrs "{}" '' - Override copilot lsp client `settings`. - The settings field is where you can set the values of the options defined in - https://github.com/zbirenbaum/copilot.lua/blob/master/SettingsOpts.md. - These options are specific to the copilot lsp and can be used to customize its behavior. + serverOptsOverrides = helpers.defaultNullOpts.mkAttrsOf' { + type = types.anything; + pluginDefault = { }; + description = '' + Override copilot lsp client `settings`. + The settings field is where you can set the values of the options defined in + https://github.com/zbirenbaum/copilot.lua/blob/master/SettingsOpts.md. + These options are specific to the copilot lsp and can be used to customize its behavior. - Ensure that the `name` field is not overridden as is is used for efficiency reasons in - numerous checks to verify copilot is actually running. + Ensure that the `name` field is not overridden as is is used for efficiency reasons in + numerous checks to verify copilot is actually running. - See `:h vim.lsp.start_client` for list of options. - - Example: - ```nix - { - trace = "verbose"; - settings = { - advanced = { - listCount = 10; # number of completions for panel - inlineSuggestCount = 3; # number of completions for getCompletions - }; + See `:h vim.lsp.start_client` for list of options. + ''; + example = { + trace = "verbose"; + settings = { + advanced = { + listCount = 10; # number of completions for panel + inlineSuggestCount = 3; # number of completions for getCompletions }; - } - ``` - ''; + }; + }; + }; }; };