Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100-- 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.clipboard = "unnamedplus" -- Use system clipboardvim.o.mouse = "a" -- Enable mousevim.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)
-- Enable all filetype plugins and syntax (if not enabled, for better startup)vim.cmd("filetype plugin indent on")if vim.fn.exists("syntax_on") ~= 1 then vim.cmd("syntax enable") end
-- 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.pumheight = 10 -- Make popup menu smallervim.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.termguicolors = true -- Use terminal gui colorsvim.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.list = true-- NOTE: use vim.opt with tables until neovim/neovim#20107 is implementedvim.opt.fillchars = { eob = " ", fold = " ", foldopen = "", foldsep = " ", foldclose = "" }vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
-- 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.opt.inccommand = "split" -- Preview substitutions live, as you type!vim.o.infercase = true -- Infer case in built-in completionvim.o.scrolloff = 15 -- Keep a minimum of 15 lines above/below cursorvim.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 = 8 -- 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\+]]
-- Reduce time taken to update swapfilevim.opt.updatetime = 250vim.opt.timeoutlen = 300
-- remove search highlights by clicking escape.vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")-- Remaps previous and next to automatically center search results.vim.keymap.set("n", "n", "nzz", { noremap = true, silent = true })vim.keymap.set("n", "N", "Nzz", { noremap = true, silent = true })-- Centers the first search result.vim.keymap.set( "c", "<CR>", function() return vim.fn.getcmdtype() == "/" and "<CR>zz" or "<CR>" end, { expr = true })
-- Remapsvim.keymap.set("n", "<", "<gv", { noremap = true, silent = true })vim.keymap.set("n", ">", ">gv", { noremap = true, silent = true })
-- Keybinds for moving visual selections using shift + hjkl/arrowsvim.keymap.set("v", "<S-k>", ":m '<-2<CR>gv=gv")vim.keymap.set("v", "<S-j>", ":m '>+1<CR>gv=gv")vim.keymap.set("v", "<S-up>", ":m '<-2<CR>gv=gv")vim.keymap.set("v", "<S-down>", ":m '>+1<CR>gv=gv")