local opts = { -- this might not be needed anymore termguicolors = true, -- copy indent on a new line autoindent = true, -- :h tabstop, 2. point -- use appropriate number of spaces to insert a expandtab = true, shiftwidth = 4, softtabstop = 4, tabstop = 8, -- use english for spellchecking spelllang = "en_gb", -- tab completion, zsh style wildmode = "longest:full,full", -- put one space for join (not two) joinspaces = false, -- keep n lines above/below cursor while scrolling scrolloff = 4, -- line numbers number = true, -- manual folding foldcolumn = "0", foldlevel = 99, foldlevelstart = 99, foldenable = true, -- set the terminal title title = true, -- wrap using 'breakat' character linebreak = true, -- new split panes will split to below and right splitbelow = true, splitright = true, -- use relative line numbers relativenumber = true, -- we are already using a cursorline, don't clobber linter messages showmode = false, -- jump to the matching bracket briefly showmatch = true, -- persistent undo undofile = true, -- lower case searches ignore case, upper case searches do not ignorecase = true, smartcase = true, -- https://stackoverflow.com/a/3445040/ -- switch case labels cinoptions = "l1", } for opt, val in pairs(opts) do vim.o[opt] = val end -- interact with system clipboard vim.opt.clipboard:append('unnamedplus') vim.opt.wildignore = { '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls', '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv', '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml', '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz', '*.synctex.gz(busy)', '*.pdfsync' } -- iwhite: ignore changes in amount of white space. -- vertical: start diff mode with vertical splits -- filler: show filler lines, vim.opt.diffopt = { "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic" } -- menu: use a popup menu to show the possible completions -- preview: show extra information vim.opt.completeopt = { "menu", "menuone", "noselect" } if vim.fn.executable("rg") then vim.o.grepprg = "rg --vimgrep --no-heading --smart-case" vim.o.grepformat = "%f:%l:%c:%m,%f:%l:%m" end