----------------------------------------------------------------------------- --- moving around, searching and patterns ----------------------------------------------------------------------------- -- ignore case when using a search pattern vim.opt.ignorecase = true -- override 'ignorecase' when pattern has upper case characters vim.opt.smartcase = true ----------------------------------------------------------------------------- --- syntax, highlighting and spelling ----------------------------------------------------------------------------- -- "dark" or "light"; the background color brightness vim.opt.background = "light" ----------------------------------------------------------------------------- --- messages and info ----------------------------------------------------------------------------- -- list of flags to make messages shorter vim.opt.shortmess = "atTWoOI" -- display the current mode in the status line vim.opt.showmode = false -- the cursor already reflects the mode -- do not display a status line unless there is more than one window vim.opt.laststatus = 1 ----------------------------------------------------------------------------- --- displaying text ----------------------------------------------------------------------------- -- preserve indentation in wrapped text vim.opt.breakindent = true ----------------------------------------------------------------------------- --- editing text ----------------------------------------------------------------------------- -- line length above which to break a line vim.opt.textwidth = 78 -- list of flags that tell how automatic formatting works vim.opt.formatoptions = "tcroqn1l" -- pattern to recognize a numbered list -- [[…]] is the Lua way to disable escape sequences in strings vim.opt.formatlistpat = [[^\v\s*(((#|\a|\d{,4}|[ivx]{,4})[]:.)}/])+|[-\*.·→+])\s+]] -- whether to use a popup menu for Insert mode completion vim.opt.completeopt = { "menu", "noinsert", "popup", "preview" } -- number of spaces used for each step of (auto)indent vim.opt.shiftwidth = 2 -- round to 'shiftwidth' for "<<" and ">>" vim.opt.shiftround = true -- expand to spaces in Insert mode vim.opt.expandtab = true -- copy whitespace for indenting from previous line vim.opt.copyindent = true -- preserve kind of whitespace when changing indent vim.opt.preserveindent = true -- automatically save and restore undo history vim.opt.undofile = true ----------------------------------------------------------------------------- --- folding ----------------------------------------------------------------------------- -- folding type: "manual", "indent", "expr", "marker", "syntax" or "diff" vim.opt.foldmethod = "marker" ----------------------------------------------------------------------------- --- reading and writing files ----------------------------------------------------------------------------- -- automatically write a file when leaving a modified buffer vim.opt.autowrite = true -- as 'autowrite', but works with more commands vim.opt.autowriteall = true -- automatically read a file when it was modified outside of Vim vim.opt.autoread = true ----------------------------------------------------------------------------- --- the swap file ----------------------------------------------------------------------------- -- list of directories for the swap file vim.opt.directory = { ".", vim.g.statedir .. "/swap//", "/var/tmp//", "$TMPDIR//", "/tmp//" } ----------------------------------------------------------------------------- --- command line editing ----------------------------------------------------------------------------- -- list of patterns to ignore files for file name completion vim.opt.wildignore = { "*.o", "*.pyc", "*.pyo", "*~", "*.bk", "*.bak" } ----------------------------------------------------------------------------- --- various ----------------------------------------------------------------------------- -- safer working with script files in the current directory vim.opt.secure = true -- list that specifies what to write in the ShaDa file vim.opt.shada = { "!", "%", "'100", "/100", ":100", "<100", "@100", "f1", "h", "s10" } -- location of shada file vim.opt.shadafile = vim.g.statedir .. "shada/main.shada" -- disable the mouse entirely vim.opt.mouse = ""