mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-01-18 16:02:24 +00:00
various: address diniamo's review comments
This commit is contained in:
parent
5250f8e771
commit
3825793549
4 changed files with 19 additions and 15 deletions
|
@ -13,7 +13,7 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
|
|
||||||
spellcheck = {
|
spellcheck = {
|
||||||
enable = isMaximal;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
|
@ -28,7 +28,7 @@ configuration formats.
|
||||||
|
|
||||||
### `vim.maps` rewrite {#sec-vim-maps-rewrite}
|
### `vim.maps` rewrite {#sec-vim-maps-rewrite}
|
||||||
|
|
||||||
Instead of specifying map modes using submodules (e.g.: `vim.maps.normal`), a
|
Instead of specifying map modes using submodules (e.g., `vim.maps.normal`), a
|
||||||
new `vim.keymaps` submodule with support for a `mode` option has been
|
new `vim.keymaps` submodule with support for a `mode` option has been
|
||||||
introduced. It can be either a string, or a list of strings, where a string
|
introduced. It can be either a string, or a list of strings, where a string
|
||||||
represents the short-name of the map mode(s), that the mapping should be set
|
represents the short-name of the map mode(s), that the mapping should be set
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.strings) concatLines;
|
inherit (lib.strings) concatLines concatStringsSep optionalString;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.types) listOf str attrsOf;
|
inherit (lib.types) listOf str attrsOf;
|
||||||
inherit (lib.nvim.lua) listToLuaTable;
|
inherit (lib.nvim.lua) listToLuaTable;
|
||||||
|
@ -134,10 +134,17 @@ in {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
spell = true;
|
spell = true;
|
||||||
spelllang = cfg.languages;
|
|
||||||
|
# Workaround for Neovim's spelllang setup. It can be
|
||||||
|
# - a string, e.g., "en"
|
||||||
|
# - multiple strings, separated with commas, e.g., "en,de"
|
||||||
|
# toLuaObject cannot generate the correct type here, unless we take a string here.
|
||||||
|
spelllang = concatStringsSep "," cfg.languages;
|
||||||
};
|
};
|
||||||
|
|
||||||
luaConfigRC.spellcheck = entryAfter ["basic"] ''
|
# Register an autocommand to disable spellchecking in buffers with given filetypes.
|
||||||
|
# If the list is empty, the autocommand does not need to be registered.
|
||||||
|
luaConfigRC.spellcheck = entryAfter ["basic"] (optionalString (cfg.ignoredFiletypes != []) ''
|
||||||
-- Disable spellchecking for certain filetypes
|
-- Disable spellchecking for certain filetypes
|
||||||
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
||||||
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
||||||
|
@ -148,7 +155,7 @@ in {
|
||||||
vim.opt_local.spell = false
|
vim.opt_local.spell = false
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
'';
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,13 +238,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
signcolumn = mkOption {
|
signcolumn = mkOption {
|
||||||
type = either str bool;
|
type = str;
|
||||||
default = true;
|
default = "yes";
|
||||||
apply = x:
|
example = "no";
|
||||||
if isBool x
|
description = "Whether to show the sign column";
|
||||||
then toVimBool x # convert to a yes/no str
|
|
||||||
else x;
|
|
||||||
description = "Show the sign column";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tabstop = mkOption {
|
tabstop = mkOption {
|
||||||
|
@ -313,7 +310,7 @@ in {
|
||||||
if [](#opt-vim.enableLuaLoader) is set to true.
|
if [](#opt-vim.enableLuaLoader) is set to true.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
example = literalExpression ''''${builtins.readFile ./my-lua-config-pre.lua}'';
|
example = literalExpression "\${builtins.readFile ./my-lua-config-pre.lua}";
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
Verbatim lua code that will be inserted **before**
|
Verbatim lua code that will be inserted **before**
|
||||||
|
@ -357,7 +354,7 @@ in {
|
||||||
luaConfigPost = mkOption {
|
luaConfigPost = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = "";
|
default = "";
|
||||||
example = literalExpression ''"$${builtins.readFile ./my-lua-config-post.lua}"'';
|
example = literalExpression "\${builtins.readFile ./my-lua-config-post.lua}";
|
||||||
description = ''
|
description = ''
|
||||||
Verbatim lua code that will be inserted **after**
|
Verbatim lua code that will be inserted **after**
|
||||||
the result of the `luaConfigRc` DAG has been resolved
|
the result of the `luaConfigRc` DAG has been resolved
|
||||||
|
|
Loading…
Reference in a new issue