Merge pull request #215 from NotAShelf/basic

modules/basic: fix search sensitivity options; restructure
This commit is contained in:
raf 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"] ''
${optionalString cfg.debugMode.enable ''
" Debug mode settings
set verbose=${toString cfg.debugMode.level}
set verbosefile=${cfg.debugMode.logFile}
''}
" Settings that are set for everything
set encoding=utf-8
set mouse=${cfg.mouseSupport}
@ -79,15 +73,24 @@ in {
set cursorlineopt=${toString cfg.cursorlineOpt}
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 ''
set splitbelow
''}
${optionalString cfg.splitRight ''
set splitright
''}
${optionalString cfg.showSignColumn ''
set signcolumn=yes
''}
${optionalString cfg.autoIndent ''
set autoindent
''}
@ -97,67 +100,85 @@ in {
set nobackup
set nowritebackup
''}
${optionalString (cfg.bell == "none") ''
set noerrorbells
set novisualbell
''}
${optionalString (cfg.bell == "on") ''
set novisualbell
''}
${optionalString (cfg.bell == "visual") ''
set noerrorbells
''}
${optionalString (cfg.lineNumberMode == "relative") ''
set relativenumber
''}
${optionalString (cfg.lineNumberMode == "number") ''
set number
''}
${optionalString (cfg.lineNumberMode == "relNumber") ''
set number relativenumber
''}
${optionalString cfg.useSystemClipboard ''
set clipboard+=unnamedplus
''}
${optionalString cfg.mapLeaderSpace ''
let mapleader=" "
let maplocalleader=" "
''}
${optionalString cfg.syntaxHighlighting ''
syntax on
''}
${optionalString (!cfg.wordWrap) ''
set nowrap
''}
${optionalString cfg.hideSearchHighlight ''
set nohlsearch
set incsearch
''}
${optionalString cfg.colourTerm ''
set termguicolors
set t_Co=256
''}
${optionalString (!cfg.enableEditorconfig) ''
let g:editorconfig = v:false
''}
${optionalString cfg.spellChecking.enable ''
set spell
set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
''}
${optionalString (cfg.leaderKey != null) ''
let mapleader = "${toString cfg.leaderKey}"
''}
${optionalString (cfg.searchCase == "ignore") ''
set nosmartcase
set ignorecase
''}
${optionalString (cfg.searchCase == "smart") ''
set noignorecase
set smartcase
set ignorecase
''}
${optionalString (cfg.searchCase == "sensitive") ''
set noignorecase
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 = {
enable = mkEnableOption "neovim's built-in spellchecking";
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 {
type = types.bool;
default = true;
@ -98,13 +100,24 @@ in {
mouseSupport = mkOption {
type = with types; enum ["a" "n" "v" "i" "c"];
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 {
type = with types; enum ["relative" "number" "relNumber" "none"];
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 {
@ -178,8 +191,6 @@ in {
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 {
type = types.enum ["ignore" "smart" "sensitive"];
default = "sensitive";