113 lines
3.9 KiB
Lua
113 lines
3.9 KiB
Lua
local g = vim.g -- Global variables
|
|
local opt = vim.opt -- Set options (global/buffer/windows-scoped)
|
|
|
|
-----------------------------------------------------------
|
|
-- General
|
|
-----------------------------------------------------------
|
|
opt.mouse = 'a' -- Enable mouse support
|
|
opt.swapfile = false -- Don't use swapfile
|
|
opt.modelines = 0 -- Disable modelines
|
|
opt.encoding = 'utf-8' -- Set default encoding to UTF-8
|
|
|
|
-- Note that this setting is important for which-key. Also don't reduce it too
|
|
-- low, or the behavior will start getting wonky and always show which-key.
|
|
opt.timeoutlen = 500 -- Time in ms to wait for a sequnece to complete
|
|
|
|
opt.shortmess:remove("F"):append("c")
|
|
|
|
opt.wildignore = {
|
|
'*.class', '*.pyc', '*.swp', '*.o', '*.jar', '*/tmp/*', '*.zip',
|
|
'*.tar', '*.gz', '*.bz2', '*.xz', '*/.git/*', '*/.metals/*',
|
|
'*/.bloop/*', '*/.bsp/*', '*/node_modules/*'
|
|
}
|
|
|
|
-----------------------------------------------------------
|
|
-- Completion
|
|
-----------------------------------------------------------
|
|
|
|
-- menu = use a popup menu to show possible completions
|
|
-- menuone = show a menu even if there is only one match
|
|
-- noinsert = do not insert text for a match until user selects one
|
|
-- noselect = do not select a match from the menu automatically
|
|
opt.completeopt = 'menu,menuone,noinsert,noselect'
|
|
g.completion_enable_auto_popup = 1 -- Enable completions while typing
|
|
|
|
-----------------------------------------------------------
|
|
-- Neovim UI
|
|
-----------------------------------------------------------
|
|
opt.number = true -- Show line number
|
|
opt.cursorline = true -- Highlight the current line
|
|
opt.showcmd = true -- Show incomplete commands at the bottom
|
|
opt.ttyfast = true -- Rendering optimizations
|
|
opt.showmatch = true -- Highlight matching parenthesis
|
|
opt.colorcolumn = '80' -- Line length marker at 80 columns
|
|
opt.ruler = true -- Show row and column number
|
|
opt.signcolumn = 'yes' -- Always show the sign column
|
|
opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker')
|
|
opt.splitright = true -- Vertical split to the right
|
|
opt.splitbelow = true -- Horizontal split to the bottom
|
|
opt.linebreak = true -- Wrap on word boundary
|
|
opt.termguicolors = true -- Enable 24-bit RGB colors
|
|
opt.laststatus = 3 -- Set global statusline
|
|
|
|
-----------------------------------------------------------
|
|
-- Tabs, indent
|
|
-----------------------------------------------------------
|
|
opt.tabstop = 4
|
|
opt.shiftwidth = 4
|
|
opt.softtabstop = 4
|
|
opt.expandtab = true
|
|
opt.smarttab = true
|
|
opt.autoindent = true
|
|
|
|
-----------------------------------------------------------
|
|
-- Memory, CPU
|
|
-----------------------------------------------------------
|
|
opt.hidden = true -- Enable background buffers
|
|
opt.lazyredraw = true -- Faster scrolling
|
|
opt.synmaxcol = 240 -- Max column for syntax highlight
|
|
opt.updatetime = 500 -- ms to wait for trigger an event
|
|
|
|
-----------------------------------------------------------
|
|
-- History
|
|
-----------------------------------------------------------
|
|
opt.history = 512
|
|
opt.undolevels = 128
|
|
opt.undofile = true
|
|
|
|
-----------------------------------------------------------
|
|
-- Search
|
|
-----------------------------------------------------------
|
|
opt.ignorecase = true
|
|
opt.smartcase = true
|
|
opt.incsearch = true
|
|
opt.showmatch = true
|
|
opt.hlsearch = true
|
|
|
|
-----------------------------------------------------------
|
|
-- Startup
|
|
-----------------------------------------------------------
|
|
-- Disable nvim intro
|
|
opt.shortmess:append "sI"
|
|
|
|
-- Disable builtins plugins
|
|
local disabled_built_ins = {
|
|
"gzip",
|
|
"zip",
|
|
"zipPlugin",
|
|
"tar",
|
|
"tarPlugin",
|
|
"getscript",
|
|
"getscriptPlugin",
|
|
"vimball",
|
|
"vimballPlugin",
|
|
"2html_plugin",
|
|
"logipat",
|
|
"rrhelper",
|
|
"spellfile_plugin",
|
|
"matchit"
|
|
}
|
|
|
|
for _, plugin in pairs(disabled_built_ins) do
|
|
g["loaded_" .. plugin] = 1
|
|
end
|