neovim/lua/core/options.lua

72 lines
1.8 KiB
Lua
Raw Normal View History

-- Search and replace
-- Ignore case except when using a capital case
-- Highlight found occurrences
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.hlsearch = true
-- Preview changes when searching and substituing
-- nosplit avoid to display the preview in a separate split
vim.o.inccommand = "nosplit"
-- Display relative line numbers
-- Except to the active line
vim.opt.relativenumber = true
vim.opt.number = true
-- Set the maximum width of a line
vim.opt.textwidth = 79
-- Display the cusor column at 79+1 column
vim.o.colorcolumn = '+1'
-- Enable mouse mode
vim.opt.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- See `:help 'clipboard'`
vim.opt.clipboard = 'unnamedplus'
-- Tabs and indentation
vim.opt.tabstop = 2
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
-- Enable break indent
vim.opt.breakindent = true
-- Look and feel
-- NOTE: You should make sure your terminal supports this
vim.opt.termguicolors = true
-- Keep signcolumn on by default
vim.opt.signcolumn = 'yes'
-- Splits
-- Display vertical split on the right, and horizontal split below
vim.opt.splitright = true
vim.opt.splitbelow = true
-- Save undo history
vim.opt.undofile = true
-- Case insensitive searching UNLESS /C or capital in search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Decrease update time
vim.opt.updatetime = 250
vim.opt.timeout = true
vim.opt.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.opt.completeopt = 'menuone,noselect'
-- Spelling
-- Set the spelling for English, French and German
vim.opt.spelllang = 'en,fr'
-- Words with a '-' are a single (composed) word
vim.opt.iskeyword:append("-")
-- Set the folding level to 1, to allow level 2 headers to be seen.
vim.opt.foldlevel = 1