options.lua
~/.config/nvim/lua/config/options.lua
-- Essential keymaps
-- Rebind space in normal mode to leader
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- workaround
-- https://github.com/neovim/neovim/issues/31675#issuecomment-2558405042
vim.hl = vim.highlight
-- Make line numbers default
vim.opt.number = true
-- Save undo history
vim.opt.undofile = true
-- menu - Shows the completion menu
-- menuone - Shows the menu even when there's only one match
-- noselect - Prevents automatic selection of the first completion item
vim.opt.completeopt = "menu,menuone,noselect"
-- just use space
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
-- Enable display of invisible characters
vim.opt.list = true
vim.opt.listchars = "tab:» ,eol:↲,nbsp:+,trail:-"
-- Case insensitive searching UNLESS /C or capital in search
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.termguicolors = true
-- Disables all automatic fold opening
vim.opt.foldopen = ""
vim.opt.autochdir = true