Compare commits

...

5 commits

Author SHA1 Message Date
diniamo
284fb9d924
Merge f1edabb210 into dfdad4c2ce 2024-11-09 13:36:45 +01:00
Ching Pei Yang
dfdad4c2ce
lazy: update lazy.plugins default 2024-11-08 19:03:01 +01:00
raf
43e3663b2b
Merge pull request #445 from horriblename/fix/devicon-color
nvim-web-devicons: re-enable icon color
2024-11-08 20:54:08 +03:00
Ching Pei Yang
b302e151e1
devicon: re-enable icon color
was mistakenly disabled in a6bb6e1b3e
2024-11-08 18:46:15 +01:00
diniamo
f1edabb210 nvim-cmp: move text and snippet completions to the bottom
This doesn't guarantee that snippets will be above text completions, but
that should still be the case, since the `kind` comparator sorts
snippets above text.
2024-11-04 22:21:45 +01:00
4 changed files with 24 additions and 2 deletions

View file

@ -42,6 +42,20 @@ in {
after = '' after = ''
${optionalString luasnipEnable "local luasnip = require('luasnip')"} ${optionalString luasnipEnable "local luasnip = require('luasnip')"}
local cmp = require("cmp") local cmp = require("cmp")
local kinds = require("cmp.types").lsp.CompletionItemKind
local deprio = function(kind)
return function(e1, e2)
if e1:get_kind() == kind then
return false
end
if e2:get_kind() == kind then
return true
end
return nil
end
end
cmp.setup(${toLuaObject cfg.setupOpts}) cmp.setup(${toLuaObject cfg.setupOpts})
${optionalString config.vim.lazy.enable ${optionalString config.vim.lazy.enable

View file

@ -29,6 +29,8 @@ in {
sorting.comparators = mkOption { sorting.comparators = mkOption {
type = mergelessListOf (either str luaInline); type = mergelessListOf (either str luaInline);
default = [ default = [
(mkLuaInline "deprio(kinds.Text)")
(mkLuaInline "deprio(kinds.Snippet)")
"offset" "offset"
"exact" "exact"
"score" "score"
@ -43,6 +45,12 @@ in {
(see `:help cmp-config.sorting.comparators`), (see `:help cmp-config.sorting.comparators`),
or a string, in which case the builtin comparator with that name will or a string, in which case the builtin comparator with that name will
be used. be used.
A `deprio` function and a `kinds`
(`require("cmp.types").lsp.CompletionItemKind`) variable is provided
above `setupOpts`. By passing a type to the funcion, the returned
function will be a comparator that always ranks the specified kind the
lowest.
''; '';
apply = map ( apply = map (
c: c:

View file

@ -16,7 +16,7 @@ in {
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]"; enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
setupOpts = mkPluginSetupOption "nvim-web-devicons" { setupOpts = mkPluginSetupOption "nvim-web-devicons" {
color_icons = mkEnableOption "different highlight colors per icon"; color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
variant = mkOption { variant = mkOption {
type = nullOr (enum ["light" "dark"]); type = nullOr (enum ["light" "dark"]);
default = null; default = null;

View file

@ -189,7 +189,7 @@ in {
}; };
plugins = mkOption { plugins = mkOption {
default = []; default = {};
type = attrsOf lznPluginType; type = attrsOf lznPluginType;
description = '' description = ''
Plugins to lazy load. Plugins to lazy load.