Merge pull request #215 from NotAShelf/basic

modules/basic: fix search sensitivity options; restructure
This commit is contained in:
NotAShelf 2024-02-13 22:13:35 +03:00 committed by GitHub
commit 3c61c8e419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 50 additions and 18 deletions

View file

@ -58,12 +58,6 @@ in {
}; };
vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] '' vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] ''
${optionalString cfg.debugMode.enable ''
" Debug mode settings
set verbose=${toString cfg.debugMode.level}
set verbosefile=${cfg.debugMode.logFile}
''}
" Settings that are set for everything " Settings that are set for everything
set encoding=utf-8 set encoding=utf-8
set mouse=${cfg.mouseSupport} set mouse=${cfg.mouseSupport}
@ -79,15 +73,24 @@ in {
set cursorlineopt=${toString cfg.cursorlineOpt} set cursorlineopt=${toString cfg.cursorlineOpt}
set scrolloff=${toString cfg.scrollOffset} set scrolloff=${toString cfg.scrollOffset}
${optionalString cfg.debugMode.enable ''
" Debug mode settings
set verbose=${toString cfg.debugMode.level}
set verbosefile=${cfg.debugMode.logFile}
''}
${optionalString cfg.splitBelow '' ${optionalString cfg.splitBelow ''
set splitbelow set splitbelow
''} ''}
${optionalString cfg.splitRight '' ${optionalString cfg.splitRight ''
set splitright set splitright
''} ''}
${optionalString cfg.showSignColumn '' ${optionalString cfg.showSignColumn ''
set signcolumn=yes set signcolumn=yes
''} ''}
${optionalString cfg.autoIndent '' ${optionalString cfg.autoIndent ''
set autoindent set autoindent
''} ''}
@ -97,67 +100,85 @@ in {
set nobackup set nobackup
set nowritebackup set nowritebackup
''} ''}
${optionalString (cfg.bell == "none") '' ${optionalString (cfg.bell == "none") ''
set noerrorbells set noerrorbells
set novisualbell set novisualbell
''} ''}
${optionalString (cfg.bell == "on") '' ${optionalString (cfg.bell == "on") ''
set novisualbell set novisualbell
''} ''}
${optionalString (cfg.bell == "visual") '' ${optionalString (cfg.bell == "visual") ''
set noerrorbells set noerrorbells
''} ''}
${optionalString (cfg.lineNumberMode == "relative") '' ${optionalString (cfg.lineNumberMode == "relative") ''
set relativenumber set relativenumber
''} ''}
${optionalString (cfg.lineNumberMode == "number") '' ${optionalString (cfg.lineNumberMode == "number") ''
set number set number
''} ''}
${optionalString (cfg.lineNumberMode == "relNumber") '' ${optionalString (cfg.lineNumberMode == "relNumber") ''
set number relativenumber set number relativenumber
''} ''}
${optionalString cfg.useSystemClipboard '' ${optionalString cfg.useSystemClipboard ''
set clipboard+=unnamedplus set clipboard+=unnamedplus
''} ''}
${optionalString cfg.mapLeaderSpace '' ${optionalString cfg.mapLeaderSpace ''
let mapleader=" " let mapleader=" "
let maplocalleader=" " let maplocalleader=" "
''} ''}
${optionalString cfg.syntaxHighlighting '' ${optionalString cfg.syntaxHighlighting ''
syntax on syntax on
''} ''}
${optionalString (!cfg.wordWrap) '' ${optionalString (!cfg.wordWrap) ''
set nowrap set nowrap
''} ''}
${optionalString cfg.hideSearchHighlight '' ${optionalString cfg.hideSearchHighlight ''
set nohlsearch set nohlsearch
set incsearch set incsearch
''} ''}
${optionalString cfg.colourTerm '' ${optionalString cfg.colourTerm ''
set termguicolors set termguicolors
set t_Co=256 set t_Co=256
''} ''}
${optionalString (!cfg.enableEditorconfig) '' ${optionalString (!cfg.enableEditorconfig) ''
let g:editorconfig = v:false let g:editorconfig = v:false
''} ''}
${optionalString cfg.spellChecking.enable '' ${optionalString cfg.spellChecking.enable ''
set spell set spell
set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"} set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
''} ''}
${optionalString (cfg.leaderKey != null) '' ${optionalString (cfg.leaderKey != null) ''
let mapleader = "${toString cfg.leaderKey}" let mapleader = "${toString cfg.leaderKey}"
''} ''}
${optionalString (cfg.searchCase == "ignore") '' ${optionalString (cfg.searchCase == "ignore") ''
set nosmartcase set nosmartcase
set ignorecase set ignorecase
''} ''}
${optionalString (cfg.searchCase == "smart") '' ${optionalString (cfg.searchCase == "smart") ''
set noignorecase
set smartcase set smartcase
set ignorecase
''} ''}
${optionalString (cfg.searchCase == "sensitive") '' ${optionalString (cfg.searchCase == "sensitive") ''
set noignorecase
set nosmartcase set nosmartcase
set noignorecase
''} ''}
''; '';
}; };

View file

@ -30,6 +30,14 @@ in {
}; };
}; };
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
leaderKey = mkOption {
type = with types; nullOr str;
default = null;
description = "The leader key to be used internally";
};
spellChecking = { spellChecking = {
enable = mkEnableOption "neovim's built-in spellchecking"; enable = mkEnableOption "neovim's built-in spellchecking";
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words"; enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
@ -41,12 +49,6 @@ in {
}; };
}; };
leaderKey = mkOption {
type = with types; nullOr str;
default = null;
description = "The leader key to be used internally";
};
colourTerm = mkOption { colourTerm = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -98,13 +100,24 @@ in {
mouseSupport = mkOption { mouseSupport = mkOption {
type = with types; enum ["a" "n" "v" "i" "c"]; type = with types; enum ["a" "n" "v" "i" "c"];
default = "a"; default = "a";
description = "Set modes for mouse support. a - all, n - normal, v - visual, i - insert, c - command"; description = ''
Set modes for mouse support.
* a - all
* n - normal
* v - visual
* i - insert
* c - command
'';
}; };
lineNumberMode = mkOption { lineNumberMode = mkOption {
type = with types; enum ["relative" "number" "relNumber" "none"]; type = with types; enum ["relative" "number" "relNumber" "none"];
default = "relNumber"; default = "relNumber";
description = "How line numbers are displayed. none, relative, number, relNumber"; description = ''
How line numbers are displayed. Available options are
none, relative, number, relNumber
'';
}; };
preventJunkFiles = mkOption { preventJunkFiles = mkOption {
@ -178,8 +191,6 @@ in {
description = "Highlight the text line of the cursor with CursorLine hl-CursorLine"; description = "Highlight the text line of the cursor with CursorLine hl-CursorLine";
}; };
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
searchCase = mkOption { searchCase = mkOption {
type = types.enum ["ignore" "smart" "sensitive"]; type = types.enum ["ignore" "smart" "sensitive"];
default = "sensitive"; default = "sensitive";