Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules/basic: fix search sensitivity options; restructure #215

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading