Skip to content

Commit

Permalink
modules/basic: fix search sensitivity options; restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Feb 12, 2024
1 parent 98e6782 commit e73469d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
37 changes: 29 additions & 8 deletions modules/basic/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
''}
Expand All @@ -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
''}
'';
};
Expand Down
31 changes: 21 additions & 10 deletions modules/basic/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit e73469d

Please sign in to comment.