Something went wrong. Try again.
Neovim config generator based on MINI nvim-mini.org/MiniMax
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126-- ┌──────────────────────────┐-- │ Built-in Neovim behavior │-- └──────────────────────────┘---- This file defines Neovim's built-in behavior. The goal is to improve overall-- usability in a way that works best with MINI.---- Here `vim.o.xxx = value` sets default value of option `xxx` to `value`.-- See `:h 'xxx'` (replace `xxx` with actual option name).---- Option values can be customized on a per buffer or window basis.-- See 'after/ftplugin/' for common example.---- Notes:-- - Some options (like `:h 'exrc'`) need to be set before this file is sourced.-- Set them directly at the bottom of the 'init.lua' file.
-- stylua: ignore start-- The next part (until `-- stylua: ignore end`) is aligned manually for easier-- reading. Consider preserving this or remove `-- stylua` lines to autoformat.
-- General ====================================================================vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
vim.o.mouse = 'a' -- Enable mousevim.o.mousescroll = 'ver:25,hor:6' -- Customize mouse scrollvim.o.switchbuf = 'usetab' -- Use already opened buffers when switchingvim.o.undofile = true -- Enable persistent undo
vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup)
-- UI =========================================================================vim.o.breakindent = true -- Indent wrapped lines to match line startvim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)vim.o.colorcolumn = '+1' -- Draw column on the right of maximum widthvim.o.cursorline = true -- Enable current line highlightingvim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)vim.o.list = true -- Show helpful text indicatorsvim.o.number = true -- Show line numbersvim.o.pumborder = 'single' -- Use border in popup menuvim.o.pumheight = 10 -- Make popup menu smallervim.o.pummaxwidth = 100 -- Make popup menu not too widevim.o.ruler = false -- Don't show cursor coordinatesvim.o.shortmess = 'CFOSWaco' -- Disable some built-in completion messagesvim.o.showmode = false -- Don't show mode in command linevim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)vim.o.splitbelow = true -- Horizontal splits will be belowvim.o.splitkeep = 'screen' -- Reduce scroll during window splitvim.o.splitright = true -- Vertical splits will be to the rightvim.o.winborder = 'single' -- Use border in floating windowsvim.o.wrap = false -- Don't visually wrap lines (toggle with \w)
vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line
-- Special UI symbols. More is set via 'mini.basics' later.vim.o.fillchars = 'eob: ,fold:╌'vim.o.listchars = 'extends:…,nbsp:␣,precedes:…,tab:> '
-- Folds (see `:h fold-commands`, `:h zM`, `:h zR`, `:h zA`, `:h zj`)vim.o.foldlevel = 10 -- Fold nothing by default; set to 0 or 1 to foldvim.o.foldmethod = 'indent' -- Fold based on indent levelvim.o.foldnestmax = 10 -- Limit number of fold levelsvim.o.foldtext = '' -- Show text under fold with its highlighting
-- Editing ====================================================================vim.o.autoindent = true -- Use auto indentvim.o.expandtab = true -- Convert tabs to spacesvim.o.formatoptions = 'rqnl1j'-- Improve comment editingvim.o.ignorecase = true -- Ignore case during searchvim.o.incsearch = true -- Show search matches while typingvim.o.infercase = true -- Infer case in built-in completionvim.o.shiftwidth = 2 -- Use this number of spaces for indentationvim.o.smartcase = true -- Respect case if search pattern has upper casevim.o.smartindent = true -- Make indenting smartvim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate wordsvim.o.tabstop = 2 -- Show tab as this number of spacesvim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode
vim.o.iskeyword = '@,48-57,_,192-255,-' -- Treat dash as `word` textobject part
-- Pattern for a start of numbered list (used in `gw`). This reads as-- "Start of list item is: at least one special character (digit, -, +, *)-- possibly followed by punctuation (. or `)`) followed by at least one space".vim.o.formatlistpat = [[^\s*[0-9\-\+\*]\+[\.\)]*\s\+]]
-- Built-in completionvim.o.complete = '.,w,b,kspell' -- Use less sourcesvim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behaviorvim.o.completetimeout = 100 -- Limit sources delay
-- Autocommands ===============================================================
-- Don't auto-wrap comments and don't insert comment leader after hitting 'o'.-- Do on `FileType` to always override these changes from filetype plugins.local f = function() vim.cmd('setlocal formatoptions-=c formatoptions-=o') endConfig.new_autocmd('FileType', nil, f, "Proper 'formatoptions'")
-- There are other autocommands created by 'mini.basics'. See 'plugin/30_mini.lua'.
-- Diagnostics ================================================================
-- Neovim has built-in support for showing diagnostic messages. This configures-- a more conservative display while still being useful.-- See `:h vim.diagnostic` and `:h vim.diagnostic.config()`.local diagnostic_opts = { -- Show signs on top of any other sign, but only for warnings and errors signs = { priority = 9999, severity = { min = 'WARN', max = 'ERROR' } },
-- Show all diagnostics as underline (for their messages type `<Leader>ld`) underline = { severity = { min = 'HINT', max = 'ERROR' } },
-- Show more details immediately for errors on the current line virtual_lines = false, virtual_text = { current_line = true, severity = { min = 'ERROR', max = 'ERROR' }, },
-- Don't update diagnostics when typing update_in_insert = false,}
-- Use `later()` to avoid sourcing `vim.diagnostic` on startupConfig.later(function() vim.diagnostic.config(diagnostic_opts) end)-- stylua: ignore end