/ nvim / init.lua
init.lua
 1  require("config.lazy")
 2  require("config.options")
 3  require("config.mappings")
 4  require("config.lsp")
 5  require("config.autocmds")
 6  
 7  -- prevent typo when pressing `wq` or `q`
 8  vim.cmd([[
 9  cnoreabbrev <expr> W ((getcmdtype() is# ':' && getcmdline() is# 'W')?('w'):('W'))
10  cnoreabbrev <expr> Q ((getcmdtype() is# ':' && getcmdline() is# 'Q')?('q'):('Q'))
11  cnoreabbrev <expr> WQ ((getcmdtype() is# ':' && getcmdline() is# 'WQ')?('wq'):('WQ'))
12  cnoreabbrev <expr> Wq ((getcmdtype() is# ':' && getcmdline() is# 'Wq')?('wq'):('Wq'))
13  ]])
14  
15  -- for some reason vim-zig adds autoformatting on save
16  vim.g.zig_fmt_autosave = false
17  
18  vim.diagnostic.config({
19    virtual_lines = false,
20    float = {
21      border = "single",
22      severity_sort = true,
23    },
24    signs = {
25      text = {
26        [vim.diagnostic.severity.ERROR] = "",
27        [vim.diagnostic.severity.WARN] = "",
28        [vim.diagnostic.severity.INFO] = "",
29        [vim.diagnostic.severity.HINT] = "",
30      },
31    },
32  })
33  
34  -- set to false to disable stripping trailing whitespace
35  vim.g.STRIP = true