update options

This commit is contained in:
2024-11-24 19:41:37 -05:00
parent 08b02c05ad
commit 79b4bd915e
+46 -36
View File
@@ -1,44 +1,46 @@
vim.cmd('let g:netrw_liststyle = 3') local o = vim.opt
local g = vim.g
local opt = vim.opt
-- environment -- environment
opt.showmode = false o.showmode = false
g.netrw_liststyle = 3
g.netrw_banner = 0
-- :cd shows cwd -- :cd shows cwd
opt.cdhome = false o.cdhome = false
-- line numbers -- line numbers
opt.number = true o.number = true
opt.relativenumber = true o.relativenumber = true
-- tabs & indents -- tabs & indents
opt.tabstop = 3 o.tabstop = 3
opt.softtabstop = 3 o.softtabstop = 3
opt.shiftwidth = 3 o.shiftwidth = 3
opt.expandtab = true o.expandtab = true
opt.smartindent = true o.smartindent = true
opt.autoindent = true o.autoindent = true
-- line wrapping -- line wrapping
opt.wrap = false o.wrap = false
o.breakindent = true
-- keep cursor line centered -- keep cursor line centered
opt.scrolloff = 999 o.scrolloff = 999
-- search -- search
opt.ignorecase = true o.ignorecase = true
opt.smartcase = true o.smartcase = true
opt.iskeyword:append('-') -- consider string-string as a whole word o.iskeyword:append('-') -- consider string-string as a whole word
-- cursor line -- cursor line
opt.cursorline = true o.cursorline = true
-- appearance -- appearance
opt.termguicolors = true o.termguicolors = true
opt.background = 'dark' o.background = 'dark'
opt.signcolumn = 'yes' o.signcolumn = 'yes'
opt.colorcolumn = '80' o.colorcolumn = '80'
vim.diagnostic.config({ vim.diagnostic.config({
float = { float = {
border = 'rounded', border = 'rounded',
@@ -46,30 +48,38 @@ vim.diagnostic.config({
}) })
-- virtualedit -- virtualedit
opt.virtualedit = 'block' o.virtualedit = 'block'
-- backspace -- backspace
opt.backspace = 'indent,eol,start' o.backspace = 'indent,eol,start'
-- clipboard -- clipboard
opt.clipboard:append('unnamedplus') -- use system clipboard as the default register o.clipboard:append('unnamedplus') -- use system clipboard as the default register
-- split windows -- split windows
opt.splitright = true o.splitright = true
opt.splitbelow = true o.splitbelow = true
-- save me -- save me
-- opt.undodir = { os.getenv("HOME") .. "/.undo/" } -- o.undodir = { os.getenv("HOME") .. "/.undo/" }
-- set undo dir under nvim app folder -- set undo dir under nvim app folder
-- opt.undodir = { vim.fn.stdpath('config') .. '/.undo/' } -- o.undodir = { vim.fn.stdpath('config') .. '/.undo/' }
-- undodir is in .local/state/nvim/undo (default) -- undodir is in .local/state/nvim/undo (default)
opt.undodir = { vim.fn.stdpath('state') .. '/undo/' } o.undodir = { vim.fn.stdpath('state') .. '/undo/' }
opt.undofile = true o.undofile = true
-- folding -- folding
opt.foldlevel = 20 o.foldcolumn = '0'
opt.foldmethod = 'expr' o.foldlevel = 5
opt.foldexpr = 'nvim_treesitter#foldexpr()' o.foldmethod = 'expr'
o.foldexpr = 'nvim_treesitter#foldexpr()'
o.fillchars = {
foldopen = '',
foldclose = '',
fold = ' ',
foldsep = ' ',
eob = ' ',
}
-- session management -- session management
opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions' o.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'