neovim-confs/lua/core/options.lua

97 lines
2.0 KiB
Lua

local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
g.nvchad_theme = config.ui.theme
-- use filetype.lua instead of filetype.vim
g.did_load_filetypes = 0
g.do_filetype_lua = 1
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
opt.confirm = true
opt.laststatus = 3 -- global statusline
opt.title = true
opt.clipboard = "unnamedplus"
opt.cmdheight = 1
opt.cul = true -- cursor line
-- Indentline
opt.expandtab = true
opt.shiftwidth = 2
opt.smartindent = true
-- disable tilde on end of buffer: https://github.com/neovim/neovim/pull/8546#issuecomment-643643758
opt.fillchars = { eob = " " }
opt.hidden = true
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
-- Numbers
opt.number = true
opt.numberwidth = 2
opt.relativenumber = false
opt.ruler = false
-- disable nvim intro
opt.shortmess:append "sI"
opt.signcolumn = "yes"
opt.splitbelow = true
opt.splitright = true
opt.tabstop = 8
opt.termguicolors = true
opt.timeoutlen = 400
opt.undofile = true
-- interval for writing swap file to disk, also used by gitsigns
opt.updatetime = 250
-- go to previous/next line with h,l,left arrow and right arrow
-- when cursor reaches end/beginning of line
opt.whichwrap:append "<>[]hl"
g.mapleader = " "
-- disable some builtin vim plugins
local default_plugins = {
"2html_plugin",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
}
local overridden_opts = config.options.disable_default_plugins
default_plugins = vim.tbl_deep_extend("force", default_plugins, overridden_opts or default_plugins)
for _, plugin in pairs(default_plugins) do
g["loaded_" .. plugin] = 1
end
-- set shada path
vim.schedule(function()
vim.opt.shadafile = vim.fn.expand "$HOME" .. "/.local/share/nvim/shada/main.shada"
vim.cmd [[ silent! rsh ]]
end)
-- load user options if the file exists
config.options.user()