2023-02-27 15:53:34 +01:00
|
|
|
{
|
2023-08-01 16:28:06 +02:00
|
|
|
pkgs,
|
2023-02-27 15:53:34 +01:00
|
|
|
lib,
|
|
|
|
...
|
2023-11-06 10:33:38 +01:00
|
|
|
}: let
|
2024-03-24 01:14:39 +01:00
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
|
|
|
inherit (lib.types) package path str bool int listOf enum nullOr;
|
2023-11-06 10:33:38 +01:00
|
|
|
in {
|
2023-02-27 15:53:34 +01:00
|
|
|
options.vim = {
|
2023-08-01 16:28:06 +02:00
|
|
|
package = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = package;
|
2023-08-01 16:28:06 +02:00
|
|
|
default = pkgs.neovim-unwrapped;
|
|
|
|
description = ''
|
|
|
|
The neovim package to use. You will need to use an unwrapped package for this option to work as intended.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-03-01 09:34:23 +01:00
|
|
|
debugMode = {
|
2023-06-05 22:10:25 +02:00
|
|
|
enable = mkEnableOption "debug mode";
|
2023-03-01 09:34:23 +01:00
|
|
|
level = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-03-01 09:34:23 +01:00
|
|
|
default = 20;
|
|
|
|
description = "Set the debug level";
|
|
|
|
};
|
2023-06-06 02:25:50 +02:00
|
|
|
|
2023-03-01 09:34:23 +01:00
|
|
|
logFile = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = path;
|
2023-03-01 09:34:23 +01:00
|
|
|
default = "/tmp/nvim.log";
|
|
|
|
description = "Set the log file";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-12 08:11:53 +01:00
|
|
|
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
|
|
|
|
|
|
|
|
leaderKey = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = nullOr str;
|
2024-02-12 08:11:53 +01:00
|
|
|
default = null;
|
|
|
|
description = "The leader key to be used internally";
|
|
|
|
};
|
|
|
|
|
2023-06-06 02:25:50 +02:00
|
|
|
spellChecking = {
|
|
|
|
enable = mkEnableOption "neovim's built-in spellchecking";
|
2023-08-10 13:48:18 +02:00
|
|
|
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
2023-08-06 13:24:54 +02:00
|
|
|
languages = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = listOf str;
|
2023-08-06 13:24:54 +02:00
|
|
|
description = "The languages to be used for spellchecking";
|
2023-08-10 13:48:18 +02:00
|
|
|
default = ["en"];
|
|
|
|
example = ["en" "de"];
|
2023-06-06 02:25:50 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-02-27 15:53:34 +01:00
|
|
|
colourTerm = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Set terminal up for 256 colours";
|
|
|
|
};
|
|
|
|
|
|
|
|
disableArrows = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = false;
|
|
|
|
description = "Set to prevent arrow keys from moving cursor";
|
|
|
|
};
|
|
|
|
|
|
|
|
hideSearchHighlight = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = false;
|
|
|
|
description = "Hide search highlight so it doesn't stay highlighted";
|
|
|
|
};
|
|
|
|
|
|
|
|
scrollOffset = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = 8;
|
|
|
|
description = "Start scrolling this number of lines from the top or bottom of the page.";
|
|
|
|
};
|
|
|
|
|
|
|
|
wordWrap = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Enable word wrapping.";
|
|
|
|
};
|
|
|
|
|
|
|
|
syntaxHighlighting = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Enable syntax highlighting";
|
|
|
|
};
|
|
|
|
|
|
|
|
mapLeaderSpace = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Map the space key to leader key";
|
|
|
|
};
|
|
|
|
|
|
|
|
useSystemClipboard = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-09-21 12:14:35 +02:00
|
|
|
default = false;
|
2023-02-27 15:53:34 +01:00
|
|
|
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
|
|
|
};
|
|
|
|
|
|
|
|
mouseSupport = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum ["a" "n" "v" "i" "c"];
|
2023-02-27 15:53:34 +01:00
|
|
|
default = "a";
|
2024-02-12 08:11:53 +01:00
|
|
|
description = ''
|
|
|
|
Set modes for mouse support.
|
|
|
|
|
|
|
|
* a - all
|
|
|
|
* n - normal
|
|
|
|
* v - visual
|
|
|
|
* i - insert
|
|
|
|
* c - command
|
|
|
|
'';
|
2023-02-27 15:53:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
lineNumberMode = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum ["relative" "number" "relNumber" "none"];
|
2023-02-27 15:53:34 +01:00
|
|
|
default = "relNumber";
|
2024-02-12 08:11:53 +01:00
|
|
|
description = ''
|
|
|
|
How line numbers are displayed. Available options are
|
|
|
|
none, relative, number, relNumber
|
|
|
|
'';
|
2023-02-27 15:53:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
preventJunkFiles = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = false;
|
|
|
|
description = "Prevent swapfile, backupfile from being created";
|
|
|
|
};
|
|
|
|
|
|
|
|
tabWidth = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = 4;
|
|
|
|
description = "Set the width of tabs";
|
|
|
|
};
|
|
|
|
|
|
|
|
autoIndent = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Enable auto indent";
|
|
|
|
};
|
|
|
|
|
|
|
|
cmdHeight = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = 1;
|
|
|
|
description = "Height of the command pane";
|
|
|
|
};
|
|
|
|
|
|
|
|
updateTime = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = 300;
|
|
|
|
description = "The number of milliseconds till Cursor Hold event is fired";
|
|
|
|
};
|
|
|
|
|
|
|
|
showSignColumn = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "Show the sign column";
|
|
|
|
};
|
|
|
|
|
|
|
|
bell = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum ["none" "visual" "on"];
|
2023-02-27 15:53:34 +01:00
|
|
|
default = "none";
|
|
|
|
description = "Set how bells are handled. Options: on, visual or none";
|
|
|
|
};
|
|
|
|
|
|
|
|
mapTimeout = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = int;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = 500;
|
|
|
|
description = "Timeout in ms that neovim will wait for mapped action to complete";
|
|
|
|
};
|
|
|
|
|
|
|
|
splitBelow = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "New splits will open below instead of on top";
|
|
|
|
};
|
|
|
|
|
|
|
|
splitRight = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-02-27 15:53:34 +01:00
|
|
|
default = true;
|
|
|
|
description = "New splits will open to the right";
|
|
|
|
};
|
2023-04-17 17:52:35 +02:00
|
|
|
enableEditorconfig = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = bool;
|
2023-04-22 00:05:19 +02:00
|
|
|
default = true;
|
2023-04-17 19:13:18 +02:00
|
|
|
description = "Follow editorconfig rules in current directory";
|
2023-04-17 20:56:21 +02:00
|
|
|
};
|
2023-05-09 12:14:53 +02:00
|
|
|
|
2023-05-19 14:14:25 +02:00
|
|
|
cursorlineOpt = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum ["line" "screenline" "number" "both"];
|
2023-05-19 14:14:25 +02:00
|
|
|
default = "line";
|
|
|
|
description = "Highlight the text line of the cursor with CursorLine hl-CursorLine";
|
|
|
|
};
|
|
|
|
|
2023-10-28 14:53:06 +02:00
|
|
|
searchCase = mkOption {
|
2024-03-24 01:14:39 +01:00
|
|
|
type = enum ["ignore" "smart" "sensitive"];
|
2023-10-28 14:53:06 +02:00
|
|
|
default = "sensitive";
|
|
|
|
description = "Set the case sensitivity of search";
|
|
|
|
};
|
2023-02-27 15:53:34 +01:00
|
|
|
};
|
|
|
|
}
|