]> git.madduck.net Git - etc/neovim.git/blob - .config/nvim/options.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

disable tab completion
[etc/neovim.git] / .config / nvim / options.lua
1 -----------------------------------------------------------------------------
2 --- moving around, searching and patterns
3 -----------------------------------------------------------------------------
4
5 -- ignore case when using a search pattern
6 vim.opt.ignorecase = true
7
8 -- override 'ignorecase' when pattern has upper case characters
9 vim.opt.smartcase = true
10
11 -----------------------------------------------------------------------------
12 --- syntax, highlighting and spelling
13 -----------------------------------------------------------------------------
14
15 -- "dark" or "light"; the background color brightness
16 vim.opt.background = "light"
17
18 -----------------------------------------------------------------------------
19 --- messages and info
20 -----------------------------------------------------------------------------
21
22 -- list of flags to make messages shorter
23 vim.opt.shortmess = "atTWoOI"
24
25 -- display the current mode in the status line
26 vim.opt.showmode = false -- the cursor already reflects the mode
27
28 -- do not display a status line unless there is more than one window
29 vim.opt.laststatus = 1
30
31 -----------------------------------------------------------------------------
32 --- displaying text
33 -----------------------------------------------------------------------------
34
35 -- preserve indentation in wrapped text
36 vim.opt.breakindent = true
37
38 -----------------------------------------------------------------------------
39 --- editing text
40 -----------------------------------------------------------------------------
41
42 -- line length above which to break a line
43 vim.opt.textwidth = 78
44
45 -- list of flags that tell how automatic formatting works
46 vim.opt.formatoptions = "tcroqn1l"
47
48 -- pattern to recognize a numbered list
49 -- [[…]] is the Lua way to disable escape sequences in strings
50 vim.opt.formatlistpat = [[^\v\s*(((#|\a|\d{,4}|[ivx]{,4})[]:.)}/])+|[-\*.·→+])\s+]]
51
52 -- whether to use a popup menu for Insert mode completion
53 vim.opt.completeopt = { "menu", "noinsert", "popup", "preview" }
54
55 -- number of spaces used for each step of (auto)indent
56 vim.opt.shiftwidth = 2
57
58 -- round to 'shiftwidth' for "<<" and ">>"
59 vim.opt.shiftround = true
60
61 -- expand <Tab> to spaces in Insert mode
62 vim.opt.expandtab = true
63
64 -- copy whitespace for indenting from previous line
65 vim.opt.copyindent = true
66
67 -- preserve kind of whitespace when changing indent
68 vim.opt.preserveindent = true
69
70 -- automatically save and restore undo history
71 vim.opt.undofile = true
72
73 -----------------------------------------------------------------------------
74 --- folding
75 -----------------------------------------------------------------------------
76
77 -- folding type: "manual", "indent", "expr", "marker", "syntax" or "diff"
78 vim.opt.foldmethod = "marker"
79
80 -----------------------------------------------------------------------------
81 --- reading and writing files
82 -----------------------------------------------------------------------------
83
84 -- automatically write a file when leaving a modified buffer
85 vim.opt.autowrite = true
86
87 -- as 'autowrite', but works with more commands
88 vim.opt.autowriteall = true
89
90 -- automatically read a file when it was modified outside of Vim
91 vim.opt.autoread = true
92
93 -----------------------------------------------------------------------------
94 --- the swap file
95 -----------------------------------------------------------------------------
96
97 -- list of directories for the swap file
98 vim.opt.directory = { ".", vim.g.statedir .. "/swap//", "/var/tmp//", "$TMPDIR//", "/tmp//" }
99
100 -----------------------------------------------------------------------------
101 --- command line editing
102 -----------------------------------------------------------------------------
103
104 -- list of patterns to ignore files for file name completion
105 vim.opt.wildignore = { "*.o", "*.pyc", "*.pyo", "*~", "*.bk", "*.bak" }
106
107 -----------------------------------------------------------------------------
108 --- various
109 -----------------------------------------------------------------------------
110
111 -- safer working with script files in the current directory
112 vim.opt.secure = true
113
114 -- list that specifies what to write in the ShaDa file
115 vim.opt.shada = { "!", "%", "'100", "/100", ":100", "<100", "@100", "f1", "h", "s10" }
116 -- location of shada file
117 vim.opt.shadafile = vim.g.statedir .. "shada/main.shada"
118
119 -- disable the mouse entirely
120 vim.opt.mouse = ""