modified: modules/completion/nvim-cmp/nvim-cmp.nix

This commit is contained in:
NotAShelf 2023-04-18 02:34:41 +03:00
parent ad95175224
commit acf592e8b1
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
5 changed files with 53 additions and 44 deletions

View file

@ -93,7 +93,7 @@ inputs: let
vim.autopairs.enable = true; vim.autopairs.enable = true;
vim.autocomplete = { vim.autocomplete = {
enable = false; enable = true;
type = "nvim-cmp"; type = "nvim-cmp";
}; };

View file

@ -49,10 +49,13 @@ with builtins; {
''; '';
type = types.str; type = types.str;
default = "nvim_cmp_menu_map"; default = "nvim_cmp_menu_map";
example = '' example = nvim.nmd.literalAsciiDoc ''
[source,lua]
---
function(entry, vim_item) function(entry, vim_item)
return vim_item return vim_item
end end
---
''; '';
}; };
}; };

View file

@ -12,7 +12,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp"; vim.startPlugins = optional usingNvimCmp "cmp-nvim-lsp";
vim.autocomplete.sources = ["nvim_lsp"]; vim.autocomplete.sources = {"nvim_lsp" = "[LSP]";};
vim.luaConfigRC.lsp-setup = '' vim.luaConfigRC.lsp-setup = ''
vim.g.formatsave = ${boolToString cfg.formatOnSave}; vim.g.formatsave = ${boolToString cfg.formatOnSave};

View file

@ -42,46 +42,50 @@ in {
default = true; default = true;
}; };
theme = mkOption { theme = let
description = "Theme for lualine"; themeSupported = elem config.vim.theme.name supported_themes;
default = "auto"; in
type = types.enum ( mkOption {
[ description = "Theme for lualine";
"auto" type = types.enum ([
"16color" "auto"
"gruvbox" "16color"
"ayu_dark" "gruvbox"
"ayu_light" "ayu_dark"
"ayu_mirage" "ayu_light"
"codedark" "ayu_mirage"
"dracula" "codedark"
"everforest" "dracula"
"gruvbox" "everforest"
"gruvbox_light" "gruvbox"
"gruvbox_material" "gruvbox_light"
"horizon" "gruvbox_material"
"iceberg_dark" "horizon"
"iceberg_light" "iceberg_dark"
"jellybeans" "iceberg_light"
"material" "jellybeans"
"modus_vivendi" "material"
"molokai" "modus_vivendi"
"nightfly" "molokai"
"nord" "nightfly"
"oceanicnext" "nord"
"onelight" "oceanicnext"
"palenight" "onelight"
"papercolor_dark" "palenight"
"papercolor_light" "papercolor_dark"
"powerline" "papercolor_light"
"seoul256" "powerline"
"solarized_dark" "seoul256"
"tomorrow" "solarized_dark"
"wombat" "tomorrow"
] "wombat"
++ optional (elem config.vim.theme.name supported_themes) config.vim.theme.name ]
); ++ 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 = { sectionSeparator = {
left = mkOption { left = mkOption {

View file

@ -4,7 +4,9 @@
... ...
}: }:
with lib; with lib;
with builtins; { with builtins; let
cfg = config.vim.visuals;
in {
options.vim.visuals = { options.vim.visuals = {
enable = mkEnableOption "Visual enhancements."; enable = mkEnableOption "Visual enhancements.";