| 1 | vim.g.mapleader = " " |
| 2 | vim.g.maplocalleader = "\\" |
| 3 | |
| 4 | vim.g.autoformat = true |
| 5 | |
| 6 | vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } |
| 7 | |
| 8 | local opt = vim.opt |
| 9 | |
| 10 | vim.opt.swapfile = false |
| 11 | opt.autowrite = true -- Enable auto write |
| 12 | opt.clipboard = "unnamedplus" -- Sync with system clipboard |
| 13 | opt.completeopt = "menu,menuone,noselect" |
| 14 | opt.conceallevel = 3 -- Hide * markup for bold and italic |
| 15 | opt.confirm = true -- Confirm to save changes before exiting modified buffer |
| 16 | opt.cursorline = true -- Enable highlighting of the current line |
| 17 | opt.expandtab = true -- Use spaces instead of tabs |
| 18 | opt.formatoptions = "jcroqlnt" -- tcqj |
| 19 | opt.grepformat = "%f:%l:%c:%m" |
| 20 | opt.grepprg = "rg --vimgrep" |
| 21 | opt.ignorecase = true -- Ignore case |
| 22 | opt.inccommand = "nosplit" -- preview incremental substitute |
| 23 | opt.laststatus = 3 -- global statusline |
| 24 | opt.list = true -- Show some invisible characters (tabs... |
| 25 | opt.mouse = "a" -- Enable mouse mode |
| 26 | opt.number = true -- Print line number |
| 27 | opt.pumblend = 10 -- Popup blend |
| 28 | opt.pumheight = 10 -- Maximum number of entries in a popup |
| 29 | opt.relativenumber = true -- Relative line numbers |
| 30 | opt.scrolloff = 4 -- Lines of context |
| 31 | opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" } |
| 32 | opt.shiftround = true -- Round indent |
| 33 | opt.shiftwidth = 2 -- Size of an indent |
| 34 | opt.shortmess:append({ W = true, I = true, c = true, C = true }) |
| 35 | opt.showmode = false -- Dont show mode since we have a statusline |
| 36 | opt.sidescrolloff = 8 -- Columns of context |
| 37 | opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time |
| 38 | opt.smartcase = true -- Don't ignore case with capitals |
| 39 | opt.smartindent = true -- Insert indents automatically |
| 40 | opt.spelllang = { "en" } |
| 41 | opt.splitbelow = true -- Put new windows below current |
| 42 | opt.splitkeep = "screen" |
| 43 | opt.splitright = true -- Put new windows right of current |
| 44 | opt.tabstop = 2 -- Number of spaces tabs count for |
| 45 | opt.termguicolors = true -- True color support |
| 46 | opt.timeoutlen = 300 |
| 47 | opt.undofile = true |
| 48 | opt.undolevels = 10000 |
| 49 | opt.updatetime = 200 -- Save swap file and trigger CursorHold |
| 50 | opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode |
| 51 | opt.wildmode = "longest:full,full" -- Command-line completion mode |
| 52 | opt.winminwidth = 5 -- Minimum window width |
| 53 | opt.wrap = false -- Disable line wrap |
| 54 | opt.fillchars = { |
| 55 | foldopen = "", |
| 56 | foldclose = "", |
| 57 | -- fold = "⸱", |
| 58 | fold = " ", |
| 59 | foldsep = " ", |
| 60 | diff = "╱", |
| 61 | eob = " ", |
| 62 | } |
| 63 | opt.list = false |
| 64 | |
| 65 | if vim.fn.has("nvim-0.10") == 1 then |
| 66 | opt.smoothscroll = true |
| 67 | end |
| 68 | |
| 69 | -- Fix markdown indentation settings |
| 70 | vim.g.markdown_recommended_style = 0 |
| 71 | vim.filetype.add({ extension = { mdx = "mdx", }, }) |
| 72 | vim.treesitter.language.register("markdown", "mdx") |
| 73 | |