nvim/lua/settings.lua
2026-04-18 12:54:25 -03:00

50 lines
2 KiB
Lua

-- Line numbers
vim.opt.number = true -- show absolute line numbers
vim.opt.relativenumber = true -- show relative line numbers
-- Mouse & clipboard
vim.opt.mouse = "a" -- enable mouse support
vim.opt.clipboard = "unnamedplus" -- use system clipboard
-- Visual behavior
vim.opt.termguicolors = true -- enable true colors
vim.opt.cursorline = true -- highlight the current line
vim.opt.wrap = false -- do not wrap long lines
vim.opt.signcolumn = "yes" -- always show the sign number (LSP, git)
vim.opt.colorcolumn = "80,100" -- vertical rulers
-- Scrolling
vim.opt.scrolloff = 8 -- keep space above/below cursor
vim.opt.sidescrolloff = 8 -- keep space left/right of cursor
-- Indentation
vim.opt.expandtab = true -- use spaces instead of tabs
vim.opt.tabstop = 2 -- how many spaces a tab looks like
vim.opt.shiftwidth = 2 -- how many spaces when indenting
vim.opt.softtabstop = 2 -- how many spaces a tab looks like during insert
vim.opt.smartindent = true -- auto indent in some cases
vim.opt.smarttab = true -- insert spaces at the start of a line
-- Search
vim.opt.ignorecase = true -- case-insensitive search
vim.opt.smartcase = true -- case-sensitive if uppercase is used
vim.opt.incsearch = true -- show matches while typing
vim.opt.hlsearch = false -- do not keep matches highlighted
-- Window splits
vim.opt.splitbelow = true -- horizontal splits open below
vim.opt.splitright = true -- vertical splits open to the right
-- Misc
vim.opt.undofile = true -- persist between sessions
vim.opt.updatetime = 250 -- lower the update delay
vim.opt.swapfile = false -- disable this useless shit
-- Diagnostics
vim.diagnostic.config({
virtual_text = true, -- use virtual text for diagnostics
signs = true, -- use signs for diagnostics
underline = true, -- use underline for diagnostics
update_in_insert = false, -- update diagnostics in insert mod
severity_sort = true, -- sort diagnostics by severity
})