Compare commits
8 Commits
84467cc082
...
24aa928785
Author | SHA1 | Date |
---|---|---|
Ching Pei Yang | 24aa928785 | |
raf | 12fd9d69dc | |
Frothy | dc0fa76295 | |
Frothy | 83583e9b64 | |
raf | efd8b44ce1 | |
Frothy | 9fe96ce010 | |
Pei Yang Ching | 2cec6178ab | |
Pei Yang Ching | 2c37513012 |
|
@ -13,7 +13,8 @@ Release notes for release 0.7
|
|||
|
||||
- Modified type for [](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides)
|
||||
from `anything` to a `submodule` for better type checking.
|
||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
||||
|
||||
[horriblename](https://github.com/horriblename)
|
||||
[horriblename](https://github.com/horriblename):
|
||||
|
||||
- Fix broken treesitter-context keybinds in visual mode
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})";
|
||||
mkBinding = binding: action:
|
||||
if binding.value != null
|
||||
then "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})"
|
||||
else "";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
|
@ -4,100 +4,51 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf attrs bool enum;
|
||||
inherit (lib.types) attrsOf enum nullOr submodule;
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
settingSubmodule = submodule {
|
||||
options = {
|
||||
RGB = mkBool true "Colorize #RGB hex codes";
|
||||
RRGGBB = mkBool true "Colorize #RRGGBB hex codes";
|
||||
names = mkBool true ''Colorize "Name" codes like Blue'';
|
||||
RRGGBBAA = mkBool false "Colorize #RRGGBBAA hex codes";
|
||||
rgb_fn = mkBool false "Colorize CSS rgb() and rgba() functions";
|
||||
hsl_fn = mkBool false "Colorize CSS hsl() and hsla() functions";
|
||||
css = mkBool false "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
|
||||
css_fn = mkBool false "Enable all CSS *functions*: rgb_fn, hsl_fn";
|
||||
mode = mkOption {
|
||||
description = "Set the display mode";
|
||||
type = nullOr (enum ["foreground" "background"]);
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "options"] ["vim" "ui" "colorizer" "setupOpts" "user_default_options"])
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "filetypes"] ["vim" "ui" "colorizer" "setupOpts" "filetypes"])
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "setupOpts" "defaultOptions"] ["vim" "ui" "colorizer" "options"])
|
||||
(mkRenamedOptionModule ["vim" "ui" "colorizer" "setupOpts" "filetypes"] ["vim" "ui" "colorizer" "filetypes"])
|
||||
];
|
||||
|
||||
options.vim.ui.colorizer = {
|
||||
enable = mkEnableOption "color highlighting [nvim-colorizer.lua]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "nvim-colorizer" {
|
||||
# colorizer has a non-standard setup function (takes two args), so we're not using setupOpts
|
||||
options = mkOption {
|
||||
description = ''
|
||||
Default options that apply to all filetypes. Filetype specific settings from
|
||||
[filetypes](#opt-vim.ui.colorizer.filetypes) take precedence.
|
||||
'';
|
||||
default = {};
|
||||
type = settingSubmodule;
|
||||
};
|
||||
|
||||
filetypes = mkOption {
|
||||
type = attrsOf attrs;
|
||||
default = {
|
||||
css = {};
|
||||
scss = {};
|
||||
};
|
||||
description = "Filetypes to highlight on";
|
||||
};
|
||||
|
||||
user_default_options = {
|
||||
rgb = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "#RGB hex codes";
|
||||
};
|
||||
|
||||
rrggbb = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "#RRGGBB hex codes";
|
||||
};
|
||||
|
||||
names = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''"Name" codes such as "Blue"'';
|
||||
};
|
||||
|
||||
rgb_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "CSS rgb() and rgba() functions";
|
||||
};
|
||||
|
||||
rrggbbaa = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "#RRGGBBAA hex codes";
|
||||
};
|
||||
|
||||
hsl_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "CSS hsl() and hsla() functions";
|
||||
};
|
||||
|
||||
css = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB";
|
||||
};
|
||||
|
||||
css_fn = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable all CSS *functions*: rgb_fn, hsl_fn";
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
type = enum ["foreground" "background"];
|
||||
default = "background";
|
||||
description = "Set the display mode";
|
||||
};
|
||||
|
||||
tailwind = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable tailwind colors";
|
||||
};
|
||||
|
||||
sass = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable sass colors";
|
||||
};
|
||||
|
||||
alwaysUpdate = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Update color values even if buffer is not focused, like when using cmp_menu, cmp_docs";
|
||||
};
|
||||
description = "Filetype specific settings";
|
||||
default = {};
|
||||
type = submodule {
|
||||
freeformType = attrsOf settingSubmodule;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
];
|
||||
|
||||
vim.luaConfigRC.colorizer = entryAnywhere ''
|
||||
require('colorizer').setup(${toLuaObject cfg.setupOpts})
|
||||
require('colorizer').setup(${toLuaObject cfg.filetypes}, ${toLuaObject cfg.options})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkMappingOption mkEnableOption mkOption types;
|
||||
in {
|
||||
options.vim.telescope = {
|
||||
mappings = {
|
||||
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp";
|
||||
|
||||
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
|
||||
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
|
||||
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
|
||||
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
|
||||
open = mkMappingOption "Open [Telescope]" "<leader>ft";
|
||||
|
||||
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
|
||||
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
|
||||
gitBranches = mkMappingOption "Git branches [Telescope]" "<leader>fvb";
|
||||
gitStatus = mkMappingOption "Git status [Telescope]" "<leader>fvs";
|
||||
gitStash = mkMappingOption "Git stash [Telescope]" "<leader>fvx";
|
||||
|
||||
lspDocumentSymbols = mkMappingOption "LSP Document Symbols [Telescope]" "<leader>flsb";
|
||||
lspWorkspaceSymbols = mkMappingOption "LSP Workspace Symbols [Telescope]" "<leader>flsw";
|
||||
lspReferences = mkMappingOption "LSP References [Telescope]" "<leader>flr";
|
||||
lspImplementations = mkMappingOption "LSP Implementations [Telescope]" "<leader>fli";
|
||||
lspDefinitions = mkMappingOption "LSP Definitions [Telescope]" "<leader>flD";
|
||||
lspTypeDefinitions = mkMappingOption "LSP Type Definitions [Telescope]" "<leader>flt";
|
||||
diagnostics = mkMappingOption "Diagnostics [Telescope]" "<leader>fld";
|
||||
|
||||
treesitter = mkMappingOption "Treesitter [Telescope]" "<leader>fs";
|
||||
};
|
||||
|
||||
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
|
||||
|
||||
vimgrep_arguments = mkOption {
|
||||
description = "Arguments to use for the grep command";
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"${pkgs.ripgrep}/bin/rg"
|
||||
"--color=never"
|
||||
"--no-heading"
|
||||
"--with-filename"
|
||||
"--line-number"
|
||||
"--column"
|
||||
"--smart-case"
|
||||
"--hidden"
|
||||
"--no-ignore"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue