aboutsummaryrefslogtreecommitdiff
path: root/lua/config/settings.lua
blob: 87b0ff73c86aa8ddd0d89d53c02370dd98c858cd (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
96
97
98
99
100
101
102
103
104
-- 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

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

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

-- 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 = false

-- 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.modifiable = true
vim.opt.encoding = "UTF8"

-- better completion settings for the commandline
vim.opt.wildmenu = true
vim.opt.wildmode = "longest:full,full"
vim.opt.wildignore:append({ "*.o", "*.obj", "*.pyc", "*.class", "*.jar" })

-- disable builtin plugins that I don't use
local builtin_plugs = {
  "gzip",
  "matchit",
  "matchparen",
  "netrwPlugin",
  "tarPlugin",
  "tohtml",
  "tutor",
  "zipPlugin",
  "2html_plugin",
  "getscript",
  "getscriptPlugin",
}

for i = 1, #builtin_plugs do
  vim.g['loaded_' .. builtin_plugs[i]] = true
end