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

Sun, 12 Feb 2023 14:42:31 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 12 Feb 2023 14:42:31 -0600
changeset 1014
b57969db48db
child 1015
21950cadff6b
permissions
-rw-r--r--

start nvim config

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"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 o.diffopt:append("algorithm:patience")
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 o.fillchars = "fold: ,vert:│"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 o.linebreak = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 o.listchars = "tab:⇥·,trail:◼,nbsp:◻,extends:»,precedes:«"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 o.showbreak = "» "
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19 o.termguicolors = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20 o.signcolumn = "number"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22 -- set font etc
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
23 if vim.fn.has("gui") then
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
24 o.number = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25 end
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
26
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
27 -- Behavior
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28 o.autowriteall = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29 o.ignorecase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 o.scrolloff = 15
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
31 o.sidescrolloff = 10
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
32 o.smartcase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
33 o.splitbelow = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
34 o.splitright = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
35 o.wildignorecase = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
36
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
37 -- Paths
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
38 o.tags:append(".tags,./.tags;")
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39 o.wildignore = "*~,*.o,*.pyc,.git/*,hg/*,.svn/*"
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
40
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
41 vim.api.nvim_create_autocmd("LspAttach", {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
42 once = true,
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43 callback = function(args)
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44 vim.opt.number = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 end,
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
46 })

mercurial