mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-07 19:01:35 +00:00
modules: make lib calls explicit where possible
This commit is contained in:
parent
bf1118eb28
commit
024e1a6845
41 changed files with 245 additions and 203 deletions
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-cmp
|
||||
];
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) toJSON;
|
||||
inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList mkIf mkSetLuaBinding mkMerge optionalString;
|
||||
inherit (lib.nvim) dag;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.attrsets) attrNames mapAttrsToList;
|
||||
inherit (lib.strings) concatMapStringsSep concatStringsSep optionalString;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||
|
||||
cfg = config.vim.autocomplete;
|
||||
lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable;
|
||||
|
@ -33,8 +36,8 @@
|
|||
|
||||
dagPlacement =
|
||||
if lspkindEnabled
|
||||
then dag.entryAfter ["lspkind"]
|
||||
else dag.entryAnywhere;
|
||||
then entryAfter ["lspkind"]
|
||||
else entryAnywhere;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
|
@ -195,7 +198,7 @@ in {
|
|||
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
${optionalString (config.vim.ui.borders.enable) ''
|
||||
${optionalString config.vim.ui.borders.enable ''
|
||||
-- explicitly enabled by setting ui.borders.enable = true
|
||||
-- TODO: try to get nvim-cmp to follow global border style
|
||||
window = {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption mkOption types;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.types) enum attrsOf nullOr str;
|
||||
in {
|
||||
options.vim = {
|
||||
autocomplete = {
|
||||
|
@ -16,7 +18,7 @@ in {
|
|||
};
|
||||
|
||||
type = mkOption {
|
||||
type = types.enum ["nvim-cmp"];
|
||||
type = enum ["nvim-cmp"];
|
||||
default = "nvim-cmp";
|
||||
description = "Set the autocomplete plugin. Options: [nvim-cmp]";
|
||||
};
|
||||
|
@ -31,7 +33,7 @@ in {
|
|||
|
||||
Note: only use a single attribute name per attribute set
|
||||
'';
|
||||
type = with types; attrsOf (nullOr str);
|
||||
type = attrsOf (nullOr str);
|
||||
default = {};
|
||||
example = ''
|
||||
{nvim-cmp = null; buffer = "[Buffer]";}
|
||||
|
@ -48,7 +50,7 @@ in {
|
|||
|
||||
Default is to call the menu mapping function.
|
||||
'';
|
||||
type = types.str;
|
||||
type = str;
|
||||
default = "nvim_cmp_menu_map";
|
||||
example = lib.literalMD ''
|
||||
```lua
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue