aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/nvim/lua/cfg/options.lua
blob: 47489f11a15d09ed56427f6b639c91a111ee7e5d (plain) (blame)
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
105
106
107
local opt = vim.o

opt.termguicolors = true

opt.undofile = true
opt.swapfile = false
opt.shadafile = "NONE"

opt.number = true
opt.cursorline = true
opt.signcolumn = "auto:2"
opt.showmatch = true
opt.laststatus = 3

opt.expandtab = true
opt.shiftround = true
opt.shiftwidth = 0
opt.softtabstop = -1
opt.tabstop = 4

opt.gdefault = true
opt.ignorecase = true
opt.smartcase = true

opt.splitbelow = true
opt.splitright = true
opt.splitkeep = "screen"

opt.linebreak = true
opt.breakindent = true
opt.textwidth = 80
opt.colorcolumn = "+1"
vim.opt.formatoptions:remove("t")

opt.cmdheight = 2
-- vim.o.messagesopt = "wait:5000,history:500"

vim.opt.shortmess:append({ a = true })

opt.updatetime = 250
opt.timeoutlen = 300
opt.synmaxcol = 500

vim.opt.completeopt = { "menuone", "noselect", "popup", "fuzzy" }
opt.scrolloff = 999
opt.sidescrolloff = 5

vim.schedule(function()
  opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus"
end)

vim.o.mouse = "a"

vim.opt.wildmode = { "longest", "full" }

vim.opt.cpoptions:remove({ "_" })

vim.opt.listchars = {
  tab = "> ",
  space = "·",
  extends = ">",
  precedes = "<",
  nbsp = "+",
}
opt.list = true

opt.confirm = true

opt.virtualedit = "block"
opt.spelloptions = "camel"

vim.g.loaded_node_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_python3_provider = 0

vim.opt.diffopt:append({
  ["indent-heuristic"] = true,
  hiddenoff = true,
  iblank = true,
  iwhiteall = true,
  algorithm = "histogram",
})

if vim.fn.executable("rg") then
  opt.grepprg = "rg\\ --vimgrep"
  opt.grepformat = "f:%l:%c:%m"
end

opt.pumblend = 20

vim.wo.foldmethod = "expr"
vim.wo.foldenable = false

vim.g.mapleader = " "
vim.g.maplocalleader = ","

vim.diagnostic.config({
  virtual_text = false,
  virtual_lines = false,
})

opt.sessionoptions =
  "blank,buffers,curdir,help,tabpages,winsize,winpos,terminal,localoptions"

vim.o.exrc = true