setup-cockpit/roles/neovim/files/lua/options.lua

39 lines
1.1 KiB
Lua

-- OPTIONS
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.spelllang = { 'en', 'fr' }
vim.opt.showcmd = true -- show command in bottom bar
vim.opt.cursorline = true -- highlight current line
vim.cmd('filetype indent on') -- load filetype-specific indent files
vim.opt.autoindent = true -- use indentation of previous line
vim.opt.smartindent = true -- use intelligent indentation for C
vim.opt.wildmenu = true -- visual autocomplete for command menu
vim.opt.lazyredraw = true -- redraw only when necessary
vim.opt.showmatch = true -- highlight matching braces
-- SPACES AND TABS
vim.opt.expandtab = true
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
-- SEARCHING
-- search as characters are entered
vim.opt.incsearch = true
-- highlight matches
vim.opt.hlsearch = true
-- turn off search hightlight after search
vim.keymap.set('n', '<leader>,', '<cmd>nohlsearch<CR>', { remap = false })
-- FOLDING
-- enable folding
vim.opt.foldenable = true
-- open most folds by default (0 to 99)
vim.opt.foldlevelstart = 10
-- guard against too many nested folds
vim.opt.foldnestmax = 10
-- fold based on filetype
vim.opt.foldmethod = 'syntax'