about summary refs log tree commit diff stats
path: root/modules/by-name/nv/nvim/options/default.nix
blob: e149553fe0a01e905a0a80e1ec4f74965b8b5446 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 = lib.getExe 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
  };
}