aboutsummaryrefslogtreecommitdiff
path: root/lua/config/settings.lua
blob: d901684a27c3f4193425266b8db0919d503a9cdb (plain)
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
-- enable line number and relative line numbers
vim.opt.number = true
vim.opt.relativenumber = true

-- highlight cursorline
vim.opt.cursorline = true

-- highlight column 80
vim.opt.colorcolumn = "80"

-- make splits open on bottom and right
vim.opt.splitbelow = true
vim.opt.splitright = true

-- disable line wrapping
vim.opt.wrap = false

-- setup tabs and indenting
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.autoindent = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2

-- setup a nice scrolloff value
vim.opt.scrolloff = 20
vim.opt.sidescrolloff = 10

-- make virtual edit work for blocks
vim.opt.virtualedit = "block"

-- make :s and others open a split
vim.opt.inccommand = "split"

-- search settings
vim.opt.ignorecase = true
vim.opt.smartcase = true

-- matching bracket settings
vim.opt.showmatch = true
vim.opt.matchtime = 2

-- commandline settings
vim.opt.cmdheight = 1
vim.opt.showmode = false

-- popup settings
vim.opt.pumheight = 10
vim.opt.pumblend = 10
vim.opt.winblend = 0

-- concealing settings
vim.opt.conceallevel = 0
vim.opt.concealcursor = ""

-- redraw lazilly
vim.opt.lazyredraw = true

-- lower syntax highlighing for performance
vim.opt.synmaxcol = 300

-- better completion options
vim.opt.completeopt = "menuone,noinsert,noselect"

-- enable signcolumn
vim.opt.signcolumn = "yes"

-- enable rounded borders
vim.opt.winborder = "rounded"

-- better file handling
vim.opt.backup = false
vim.opt.writebackup = false
vim.opt.swapfile = false
vim.opt.undofile = true
vim.opt.undodir = vim.fn.expand("~/.local/state/nvim/undo")
vim.opt.autoread = true
vim.opt.autowrite = true

-- durations for completion and other stuff
vim.opt.updatetime = 300
vim.opt.timeoutlen = 500
vim.opt.ttimeoutlen = 0

-- change some behaviour settings
vim.opt.hidden = true
vim.opt.errorbells = false
vim.opt.backspace = "indent,eol,start"
vim.opt.autochdir = false
vim.opt.iskeyword:append("-") -- treat dash as part of the word
vim.opt.path:append("**") -- include subdirectories in search
vim.opt.selection = "exclusive"
vim.opt.modifiable = true
vim.opt.encoding = "UTF8"