Dot_Files/.config/nvim/lua/core/options.lua

102 lines
1.9 KiB
Lua
Raw Normal View History

2022-01-10 09:55:15 -06:00
local opt = vim.opt
local M = {}
M.setup = function()
-- Number settings
opt.number = true
opt.numberwidth = 2
opt.relativenumber = false
2022-01-10 09:55:15 -06:00
-- Scroll Offset
opt.scrolloff = 3
-- Disable showmode
opt.showmode = false
-- Set truecolor support
opt.termguicolors = true
vim.cmd("highlight Normal guibg=none")
2022-01-10 09:55:15 -06:00
-- Enable system clipboard
opt.clipboard = "unnamedplus"
-- Set mouse support for any mode
opt.mouse = "a"
-- Allow hidden
opt.hidden = true
-- Useful defaults for tab, indentation, etc.
2022-01-10 09:55:15 -06:00
opt.tabstop = 4
opt.shiftwidth = 4
opt.smartindent = true
2022-03-18 05:27:50 -05:00
opt.breakindent = true
2022-01-10 09:55:15 -06:00
opt.expandtab = true
opt.smarttab = true
-- Search settings
opt.hlsearch = true
opt.incsearch = true
opt.ignorecase = true
opt.smartcase = true
2022-01-10 09:55:15 -06:00
-- Better backspaces
opt.backspace = "indent,eol,start"
-- Make new splits vertical
opt.splitright = true
2022-01-10 21:40:57 -06:00
-- Show line & column num of cursor
opt.ruler = true
2022-01-10 09:55:15 -06:00
2022-01-10 21:40:57 -06:00
-- Set timeouts
opt.ttimeoutlen = 20
opt.timeoutlen = 1000
2022-03-18 05:27:50 -05:00
opt.updatetime = 250
opt.signcolumn = "yes"
2022-01-10 09:55:15 -06:00
2022-01-10 21:40:57 -06:00
-- Enable persistent undo
opt.undodir = vim.fn.stdpath("cache") .. "/undo"
2022-01-10 21:40:57 -06:00
opt.undofile = true
2022-01-10 09:55:15 -06:00
2022-01-10 21:40:57 -06:00
-- Better folding
opt.foldmethod = "expr"
opt.foldexpr = "nvim_treesitter#foldexpr()"
2022-03-18 05:27:50 -05:00
opt.fillchars = { fold = " " }
opt.foldlevel = 20
-- Concealment for nicer rendering
opt.conceallevel = 2
opt.concealcursor = "ic"
-- Lazy Redraw to Speed Up Macros
opt.lazyredraw = true
-- Spell Settings
opt.spelllang = { "en_us" }
2022-03-18 05:27:50 -05:00
-- Better completion experience
opt.completeopt = "menuone,noselect"
2022-03-18 05:27:50 -05:00
-- Set max text width
opt.textwidth = 120
2022-03-18 05:27:50 -05:00
-- Highlight cursor line
opt.cursorline = true
2022-03-18 05:27:50 -05:00
-- Make statusline global
opt.laststatus = 3
2022-05-06 16:52:28 -05:00
-- Set listcharacters
opt.list = true
opt.listchars:append("tab:⭾⭾")
opt.listchars:append("lead:·")
2022-05-06 20:44:38 -05:00
opt.listchars:append("trail:·")
2022-05-06 16:52:28 -05:00
opt.listchars:append("extends:◣")
opt.listchars:append("precedes:◢")
opt.listchars:append("nbsp:○")
2022-01-10 09:55:15 -06:00
end
return M