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