.config/nvim/lua/config/options.lua

Sun, 19 Feb 2023 11:30:19 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 19 Feb 2023 11:30:19 -0600
changeset 1027
823290a8e710
parent 1026
b70ed2db4354
child 1039
91900ecf0e8c
permissions
-rw-r--r--

vim-polyglot has been a nuisance too often

1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 vim.g.mapleader = "\\"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 vim.g.maplocalleader = "\\"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 local o = vim.opt
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 -- Editing
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 o.expandtab = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 o.shiftround = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 o.shiftwidth = 2
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 -- Display
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 o.breakindent = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 o.breakindentopt = "min:66,shift:2"
1026
b70ed2db4354 More option fixes
Meredith Howard <mhoward@roomag.org>
parents: 1025
diff changeset
14 o.conceallevel = 3
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 o.diffopt:append("algorithm:patience")
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 o.fillchars = "fold: ,vert:│"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 o.linebreak = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 o.listchars = "tab:⇥·,trail:◼,nbsp:◻,extends:»,precedes:«"
1026
b70ed2db4354 More option fixes
Meredith Howard <mhoward@roomag.org>
parents: 1025
diff changeset
19 o.pumheight = 10
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20 o.showbreak = "» "
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21 o.termguicolors = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22 o.signcolumn = "number"
1026
b70ed2db4354 More option fixes
Meredith Howard <mhoward@roomag.org>
parents: 1025
diff changeset
23 o.winminwidth = 5
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
24
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25 -- set font etc
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
26 if vim.fn.has("gui") then
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
27 o.number = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28 end
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 -- Behavior
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
31 o.autowriteall = true
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
32 o.backup = true
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
33 o.completeopt:append({"menuone", "noselect"})
1025
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents: 1022
diff changeset
34 o.hidden = false
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
35 o.ignorecase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
36 o.scrolloff = 15
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
37 o.sessionoptions = {"buffers", "curdir", "localoptions"}
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
38 o.sidescrolloff = 10
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39 o.smartcase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
40 o.splitbelow = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
41 o.splitright = true
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
42 o.undofile = true
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43 o.wildignorecase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 -- Paths
1019
7e42fd320166 Further nvim work
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
46 o.backupdir:remove(".")
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
47 o.tags:append({".tags", "./.tags;"})
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
48 o.wildignore = "*~,*.o,*.pyc,.git/*,hg/*,.svn/*"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
49
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
50 if vim.fn.executable("ag") then
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
51 o.grepprg = "ag --vimgrep"
1026
b70ed2db4354 More option fixes
Meredith Howard <mhoward@roomag.org>
parents: 1025
diff changeset
52 o.grepformat = {"%f:%l:%c:%m", "%f"}
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
53 end

mercurial