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
|
2022-02-26 18:28:23 -06:00
|
|
|
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
|
2022-01-27 23:53:45 -06:00
|
|
|
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
|
|
|
|
|
2022-01-27 23:53:45 -06:00
|
|
|
-- 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
|
2022-02-04 08:49:41 -06:00
|
|
|
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
|
2022-01-27 23:53:45 -06:00
|
|
|
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
|
2022-01-27 23:53:45 -06:00
|
|
|
opt.foldmethod = "expr"
|
|
|
|
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
2022-03-18 05:27:50 -05:00
|
|
|
opt.fillchars = { fold = " " }
|
2022-01-28 00:01:56 -06:00
|
|
|
opt.foldlevel = 20
|
2022-01-27 23:53:45 -06:00
|
|
|
|
|
|
|
-- Concealment for nicer rendering
|
2022-02-01 13:44:40 -06:00
|
|
|
opt.conceallevel = 2
|
2022-01-27 23:53:45 -06:00
|
|
|
opt.concealcursor = "ic"
|
|
|
|
|
|
|
|
-- Lazy Redraw to Speed Up Macros
|
|
|
|
opt.lazyredraw = true
|
|
|
|
|
|
|
|
-- Spell Settings
|
|
|
|
opt.spelllang = { "en_us" }
|
2022-02-04 08:49:41 -06:00
|
|
|
|
2022-03-18 05:27:50 -05:00
|
|
|
-- Better completion experience
|
|
|
|
opt.completeopt = "menuone,noselect"
|
2022-02-07 03:55:35 -06:00
|
|
|
|
2022-03-18 05:27:50 -05:00
|
|
|
-- Set max text width
|
|
|
|
opt.textwidth = 80
|
2022-02-28 08:07:20 -06:00
|
|
|
|
2022-03-18 05:27:50 -05:00
|
|
|
-- Highlight cursor line
|
|
|
|
opt.cursorline = true
|
2022-03-18 05:25:33 -05:00
|
|
|
|
2022-03-18 05:27:50 -05:00
|
|
|
-- Make statusline global
|
|
|
|
opt.laststatus = 3
|
2022-01-10 09:55:15 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|