Merge branch 'NotAShelf:main' into add-multicursors-nvim

This commit is contained in:
Joe Hanson 2025-02-08 12:08:45 -06:00 committed by GitHub
commit 7ad217517d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 384 additions and 111 deletions

View file

@ -4,6 +4,7 @@
inherit (lib.nvim.config) batchRenameOptions;
renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] {
# 2024-12-01
colourTerm = "termguicolors";
mouseSupport = "mouse";
cmdHeight = "cmdheight";
@ -15,6 +16,9 @@
autoIndent = "autoindent";
wordWrap = "wrap";
showSignColumn = "signcolumn";
# 2025-02-07
scrollOff = "scrolloff";
};
in {
imports = concatLists [
@ -93,9 +97,15 @@ in {
# 2024-12-02
(mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"])
# 2025-02-06
(mkRemovedOptionModule ["vim" "disableArrows"] ''
Top-level convenience options are now in the process of being removed from nvf as
their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC'
to replicate previous behaviour.
'')
]
# 2024-12-01
# Migrated via batchRenameOptions. Further batch renames must be below this line.
renamedVimOpts
];

View file

@ -16,12 +16,6 @@
cfg = config.vim;
in {
options.vim = {
disableArrows = mkOption {
type = bool;
default = false;
description = "Set to prevent arrow keys from moving cursor";
};
hideSearchHighlight = mkOption {
type = bool;
default = false;

View file

@ -26,34 +26,6 @@
in {
config = {
vim.keymaps = mkMerge [
(
mkIf cfg.disableArrows [
{
key = "<up>";
mode = ["n" "i"];
action = "<nop>";
noremap = false;
}
{
key = "<down>";
mode = ["n" "i"];
action = "<nop>";
noremap = false;
}
{
key = "<left>";
mode = ["n" "i"];
action = "<nop>";
noremap = false;
}
{
key = "<right>";
mode = ["n" "i"];
action = "<nop>";
noremap = false;
}
]
)
(
pipe cfg.maps
[

View file

@ -59,6 +59,40 @@
}
'';
};
nixd = {
package = pkgs.nixd;
internalFormatter = true;
lspConfig = ''
lspconfig.nixd.setup{
capabilities = capabilities,
${
if cfg.format.enable
then useFormat
else noFormat
},
cmd = ${packageToCmd cfg.lsp.package "nixd"},
${optionalString cfg.format.enable ''
settings = {
nixd = {
${optionalString (cfg.format.type == "alejandra")
''
formatting = {
command = {"${cfg.format.package}/bin/alejandra", "--quiet"},
},
''}
${optionalString (cfg.format.type == "nixfmt")
''
formatting = {
command = {"${cfg.format.package}/bin/nixfmt"},
},
''}
},
},
''}
}
'';
};
};
defaultFormat = "alejandra";

View file

@ -87,11 +87,6 @@
type = float;
default = 0.55;
};
results_width = mkOption {
description = "";
type = float;
default = 0.8;
};
};
vertical = {
mirror = mkOption {