opts.lua

Branches > main > c4543d1 > files / nvim / lua / opts.lua

local o = vim.opt
local g = vim.g
local ac = vim.api.nvim_create_autocmd
local ag = vim.api.nvim_create_augroup

g.loaded_netrw = 1
g.loaded_netrwPlugin = 1

o.shiftwidth = 2
o.tabstop = 2
o.softtabstop = 2
o.expandtab = true

o.swapfile = false
o.backup = false
o.undofile = true

--- Prevents o/<CR> on comments from starting a new comment
ac("Filetype", {pattern = "*", callback = function()
  o.formatoptions = ""
end})

--- Completion
o.completeopt = {"menu", "menuone", "fuzzy"}

--- Loads shada after initialization :p
o.shada = ""
vim.schedule(function() vim.cmd("rshada") end)