mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
Compare commits
5 commits
b6c9ac1d68
...
284fb9d924
Author | SHA1 | Date | |
---|---|---|---|
|
284fb9d924 | ||
|
dfdad4c2ce | ||
43e3663b2b | |||
|
b302e151e1 | ||
|
f1edabb210 |
4 changed files with 24 additions and 2 deletions
|
@ -42,6 +42,20 @@ in {
|
|||
after = ''
|
||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||
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})
|
||||
|
||||
${optionalString config.vim.lazy.enable
|
||||
|
|
|
@ -29,6 +29,8 @@ in {
|
|||
sorting.comparators = mkOption {
|
||||
type = mergelessListOf (either str luaInline);
|
||||
default = [
|
||||
(mkLuaInline "deprio(kinds.Text)")
|
||||
(mkLuaInline "deprio(kinds.Snippet)")
|
||||
"offset"
|
||||
"exact"
|
||||
"score"
|
||||
|
@ -43,6 +45,12 @@ in {
|
|||
(see `:help cmp-config.sorting.comparators`),
|
||||
or a string, in which case the builtin comparator with that name will
|
||||
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 (
|
||||
c:
|
||||
|
|
|
@ -16,7 +16,7 @@ in {
|
|||
enable = mkEnableOption "Neovim dev icons [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 {
|
||||
type = nullOr (enum ["light" "dark"]);
|
||||
default = null;
|
||||
|
|
|
@ -189,7 +189,7 @@ in {
|
|||
};
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
default = {};
|
||||
type = attrsOf lznPluginType;
|
||||
description = ''
|
||||
Plugins to lazy load.
|
||||
|
|
Loading…
Reference in a new issue