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

88 lines
1.6 KiB
Lua
Raw Normal View History

2022-01-10 09:55:15 -06:00
local opt = vim.opt
2022-01-15 19:14:59 -06:00
local g = vim.g
2022-01-10 09:55:15 -06:00
local M = {}
M.setup = function()
-- Number settings
opt.number = true
opt.numberwidth = 2
opt.relativenumber = true
-- 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
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
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()"
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" }
-- Better completion experience
opt.completeopt = "menuone,noselect"
-- Set max text width
opt.textwidth = 120
2022-01-10 09:55:15 -06:00
end
return M