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