-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.lua
More file actions
56 lines (48 loc) · 4.16 KB
/
Copy pathoptions.lua
File metadata and controls
56 lines (48 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-- Disable netrw directory banner
vim.g.netrw_banner = 0
-- ── Line Numbers & Gutter ──────────────────────────────────────────────────
vim.opt.nu = true -- Show line numbers
vim.opt.relativenumber = true -- Relative line numbers for easier jump distance calculation
vim.opt.signcolumn = "yes:2" -- 2-column sign gutter (displays Git signs and LSP diagnostics side-by-side)
vim.opt.colorcolumn = "0" -- Column guide (disabled by default)
-- ── Indentation & Tabs ────────────────────────────────────────────────────
vim.opt.tabstop = 4 -- 1 tab = 4 spaces
vim.opt.softtabstop = 4 -- Number of spaces inserted on <Tab>
vim.opt.shiftwidth = 4 -- Indentation width
vim.opt.expandtab = true -- Convert tabs to spaces
vim.opt.smartindent = true -- Autoindent new lines smartly
-- ── Splits & Windows ──────────────────────────────────────────────────────
vim.opt.splitbelow = true -- Horizontal splits open below current window
vim.opt.splitright = true -- Vertical splits open to the right
vim.opt.laststatus = 3 -- Global statusline across all splits
-- ── Search & Substitution ─────────────────────────────────────────────────
vim.opt.ignorecase = true -- Case-insensitive search by default
vim.opt.smartcase = true -- Case-sensitive if query contains capital letters
vim.opt.inccommand = "split" -- Show live substitution preview in a split window
vim.opt.diffopt:append("algorithm:patience") -- Cleaner semantic diff algorithm
vim.opt.diffopt:append("linematch:60") -- Smarter diff display aligning modified lines
vim.opt.grepprg = "rg --vimgrep" -- Use ripgrep for built-in :grep
vim.opt.grepformat = "%f:%l:%c:%m"
-- ── Backup, Swap & Persistent Undo ────────────────────────────────────────
vim.opt.swapfile = false -- Disable swapfiles
vim.opt.backup = false -- Disable backup files
vim.opt.undofile = true -- Save persistent undo history to disk
vim.opt.undodir = vim.fn.stdpath("data") .. "/undodir"
-- ── Completion & Messages ─────────────────────────────────────────────────
vim.opt.completeopt = "menuone,noselect,fuzzy,nosort" -- Modern fuzzy completion behavior
vim.opt.shortmess:append("c") -- Don't show extra completion messages
vim.opt.wildignorecase = true -- Case-insensitive tab completion in commands
-- ── Folding ───────────────────────────────────────────────────────────────
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldlevel = 99 -- Keep all folds open by default
-- ── Editor Behavior & Quality of Life ─────────────────────────────────────
vim.opt.clipboard:append("unnamedplus") -- Sync with system clipboard
vim.opt.confirm = true -- Prompt to save changes on :q instead of failing
vim.opt.scrolloff = 8 -- Keep 8 lines of vertical context above/below cursor
vim.opt.sidescrolloff = 8 -- Keep 8 columns of horizontal context
vim.opt.wrap = true -- Wrap long lines visually
vim.opt.termguicolors = true -- Enable 24-bit RGB true colors
vim.opt.guicursor = "" -- Keep terminal default cursor shape
vim.opt.isfname:append("@-@") -- Include '@' in filename path matching
vim.opt.path:append("**") -- Search subdirectories recursively with gf