diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-09 12:35:44 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-09 12:54:51 +0100 |
commit | 2122a01f99c6da466b8f0f55c965c11a9043d117 (patch) | |
tree | 6c1697afc30a5bb72635bda7db9b5610386a5b71 /modules/by-name/nv/nvim/options | |
parent | fix(pkgs/stamp): Fallback to `dot-license` (diff) | |
download | nixos-config-2122a01f99c6da466b8f0f55c965c11a9043d117.tar.gz nixos-config-2122a01f99c6da466b8f0f55c965c11a9043d117.zip |
refactor(modules/legacy/conf/nvim): Move to `by-name`
Diffstat (limited to 'modules/by-name/nv/nvim/options')
-rw-r--r-- | modules/by-name/nv/nvim/options/default.nix | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/modules/by-name/nv/nvim/options/default.nix b/modules/by-name/nv/nvim/options/default.nix new file mode 100644 index 00000000..72343b72 --- /dev/null +++ b/modules/by-name/nv/nvim/options/default.nix @@ -0,0 +1,110 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.opts = lib.mkIf cfg.enable { + autoindent = true; # copy indent from previous line + cindent = true; # use c like indenting rules + breakindent = true; # continue indent visually + showbreak = "↳ "; # downwards arrow with tip rightwards(U+21B3, UTF-8: E2 86 B3) + breakindentopt = { + shift = 2; # wrapped line's beginning will be shifted by the given number of + }; + + incsearch = true; # show search results while typing + inccommand = "split"; # line preview of :s results + ignorecase = true; # ignore case when searching + smartcase = true; # if a capital letter is used in search, overwrite ignorecase + showmatch = true; # show matching words during a search. + hlsearch = true; # highlight when searching + + confirm = true; # confirm to save changes before closing modified buffer + colorcolumn = "+1"; # show a +1 before the 'textwidth' + completeopt = ["menuone" "noselect"]; # have a better completion experience + + # https://www.compart.com/en/unicode/U+XXXX (unicode character code) + fillchars = { + fold = "·"; # MIDDLE DOT (U+00B7, UTF-8: C2 B7) + horiz = "━"; # BOX DRAWINGS HEAVY HORIZONTAL (U+2501, UTF-8: E2 94 81) + horizdown = "┳"; # BOX DRAWINGS HEAVY DOWN AND HORIZONTAL (U+2533, UTF-8: E2 94 B3) + horizup = "┻"; # BOX DRAWINGS HEAVY UP AND HORIZONTAL (U+253B, UTF-8: E2 94 BB) + vert = "┃"; # BOX DRAWINGS HEAVY VERTICAL (U+2503, UTF-8: E2 94 83) + vertleft = "┫"; # BOX DRAWINGS HEAVY VERTICAL AND LEFT (U+252B, UTF-8: E2 94 AB) + vertright = "┣"; # BOX DRAWINGS HEAVY VERTICAL AND RIGHT (U+2523, UTF-8: E2 94 A3) + verthoriz = "╋"; # BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL (U+254B, UTF-8: E2 95 8B) + }; + listchars = builtins.concatStringsSep "," [ + "nbsp:⦸" # CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8) + "tab:▷┅" # WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) + "extends:»" # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB) + "precedes:«" # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB) + "trail:•" # BULLET (U+2022, UTF-8: E2 80 A2) + ]; + + # shell-like autocomplete to unambiguous portions + wildmode = builtins.concatStringsSep "," [ + "longest" + "list" + "full" + ]; + + grepformat = "%f:%l:%c:%m"; # the default format for rg in vimgrep mode + grepprg = "rg --vimgrep"; # use rg as grep implementation in `:grep` + + hidden = true; # allows you to hide buffers with unsaved changes without being prompted + + laststatus = 3; # use global statusline # TODO: + + list = true; # show whitespace + + mouse = ""; # disables the mouse + + number = true; # line numbers + relativenumber = true; # relative line numbers + + # vim.opt.shada:append {'%'}; -- store buffers in the shada file and reopen them if nvim has been started without file name argument + + shell = "${cfg.shell}"; + + spell = true; # activate spell checking + spelllang = "en_us,de_de"; # set spell languages + spelloptions = "camel"; # CamelCase check if both camel and case are correct words + + syntax = "ON"; # use syntax highlighting and let nvim figure out which + + shiftwidth = 0; # use tabstop setting as shiftwidth + tabstop = 4; # use 4 spaces in place of a tab + expandtab = true; # expand tabs to spaces + + showtabline = 2; # always show the tabline + + timeoutlen = 500; # wait 500 msec for the next char in an input sequence + ttyfast = true; # let vim know that I am using a fast term + + undofile = true; # use a undofile, to save the undos + undolevels = 10000; # keep nearly all undo things stored + + virtualedit = "block"; # allow the cursor to move beyond actual character in visual block mode + + textwidth = 90; # automatically hard wrap at 90 columns by default + + foldmethod = "marker"; # use markers to specify folds + + termguicolors = true; + cursorline = true; + # vim.opt.cursorcolumn = true; + + scrolloff = 999; # try to keep at least 999 lines above and below the cursor (this effectively keeps the screen centered) + + linebreak = true; # break to long lines, but do only break them at [[::space::]] + + showcmd = true; # show partial command, being typed + showmode = true; # show the mode (Visual, Insert, Command) + + wildmenu = true; # shell completion + wildignore = "*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx"; # ignore binary files + }; +} |