2021-07-03 20:19:46 -04:00
|
|
|
local opt = vim.opt
|
2021-09-09 13:34:09 -04:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.disable_default_plugins()
|
|
|
|
vim.g.loaded_gzip = 1
|
|
|
|
vim.g.loaded_tar = 1
|
|
|
|
vim.g.loaded_tarPlugin = 1
|
|
|
|
vim.g.loaded_zip = 1
|
|
|
|
vim.g.loaded_zipPlugin = 1
|
|
|
|
vim.g.loaded_getscript = 1
|
|
|
|
vim.g.loaded_getscriptPlugin = 1
|
|
|
|
vim.g.loaded_vimball = 1
|
|
|
|
vim.g.loaded_vimballPlugin = 1
|
|
|
|
vim.g.loaded_matchit = 1
|
|
|
|
vim.g.loaded_matchparen = 1
|
|
|
|
vim.g.loaded_2html_plugin = 1
|
|
|
|
vim.g.loaded_logiPat = 1
|
|
|
|
vim.g.loaded_rrhelper = 1
|
|
|
|
vim.g.loaded_netrw = 1
|
|
|
|
vim.g.loaded_netrwPlugin = 1
|
|
|
|
vim.g.loaded_netrwSettings = 1
|
|
|
|
vim.g.loaded_netrwFileHandlers = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
function M.load_options()
|
|
|
|
-- Global theme
|
|
|
|
vim.g.global_theme = 'nord'
|
|
|
|
-- Leader key
|
|
|
|
vim.g.mapleader = ' '
|
|
|
|
-- Python path
|
|
|
|
vim.g.python_host_prog = '/usr/bin/python'
|
|
|
|
vim.g.python3_host_prog = '/usr/bin/python3'
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- General settings
|
2021-09-02 17:53:53 -04:00
|
|
|
opt.termguicolors = true
|
2021-07-08 16:08:10 -04:00
|
|
|
opt.mouse = 'nv'
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.errorbells = false
|
|
|
|
opt.visualbell = false
|
|
|
|
opt.hidden = true
|
|
|
|
opt.fileformats = 'unix'
|
|
|
|
opt.magic = true
|
|
|
|
opt.virtualedit = 'block'
|
|
|
|
opt.encoding = 'utf-8'
|
|
|
|
opt.fileencoding = 'utf-8'
|
|
|
|
opt.clipboard = 'unnamedplus'
|
|
|
|
opt.wildignorecase = true
|
|
|
|
opt.wildignore = '.git,.hg,.svn,*.pyc,*.o,*.out,*.jpg,*.jpeg,*.png,*.gif,*.zip,**/tmp/**,*.DS_Store,**/node_modules/**'
|
|
|
|
opt.history = 1000
|
|
|
|
-- opt.showmode = false
|
|
|
|
opt.jumpoptions = 'stack'
|
|
|
|
opt.formatoptions = '1jcroql'
|
|
|
|
opt.shortmess = 'aoOTIcF'
|
|
|
|
opt.startofline = false
|
|
|
|
opt.wrap = false
|
|
|
|
opt.sidescrolloff = 4
|
|
|
|
opt.scrolloff = 4
|
|
|
|
opt.whichwrap = '<,>,[,],~'
|
|
|
|
opt.ruler = true
|
|
|
|
opt.display = 'lastline'
|
|
|
|
-- opt.colorcolumn = '80'
|
|
|
|
-- opt.cursorline = true
|
|
|
|
-- opt.backspace = 'indent,eol,start'
|
|
|
|
opt.showcmd = false
|
2021-07-06 07:26:25 -04:00
|
|
|
opt.inccommand = 'nosplit'
|
2021-07-04 15:03:20 -04:00
|
|
|
-- opt.cmdheight = 2
|
|
|
|
-- opt.cmdwinheight = 6
|
|
|
|
opt.showtabline = 2
|
|
|
|
opt.laststatus = 2
|
2021-07-10 12:40:43 -04:00
|
|
|
-- opt.textwidth = 80
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.synmaxcol = 2500
|
|
|
|
-- opt.shell = 'bash'
|
|
|
|
opt.grepformat = '%f:%l:%c:%m'
|
|
|
|
opt.grepprg = 'rg --hidden --vimgrep --smart-case --'
|
|
|
|
opt.diffopt = 'filler,iwhite,internal,algorithm:patience'
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Transparency
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.pumblend = 5
|
|
|
|
opt.winblend = 5
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Conceal
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.conceallevel = 2
|
|
|
|
opt.concealcursor = 'niv'
|
|
|
|
-- opt.foldenable = true
|
|
|
|
opt.foldlevelstart = 99
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Case insensitive
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.ignorecase = true
|
|
|
|
opt.smartcase = true
|
|
|
|
opt.infercase = true
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Searching
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.incsearch = true
|
|
|
|
opt.hlsearch = false
|
|
|
|
-- opt.wrapscan = true
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Update time
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.timeout = true
|
|
|
|
opt.ttimeout = true
|
|
|
|
opt.timeoutlen = 300
|
|
|
|
opt.ttimeoutlen = 10
|
|
|
|
opt.updatetime = 150
|
|
|
|
opt.redrawtime = 1500
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- No swapfile
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.backup = false
|
|
|
|
opt.writebackup = false
|
|
|
|
opt.swapfile = false
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Completion menu
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.wildmenu = true
|
|
|
|
opt.wildmode = 'full'
|
|
|
|
opt.complete = '.,w,b,k'
|
|
|
|
opt.completeopt = 'menuone,noselect'
|
|
|
|
opt.pumheight = 16
|
|
|
|
opt.helpheight = 12
|
|
|
|
opt.previewheight = 12
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Window rules
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.splitbelow = true
|
|
|
|
opt.splitright = true
|
|
|
|
opt.switchbuf = 'useopen'
|
|
|
|
opt.winwidth = 30
|
|
|
|
opt.winminwidth = 10
|
|
|
|
opt.equalalways = false
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Left column
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.signcolumn = 'yes'
|
|
|
|
opt.number = true
|
|
|
|
opt.relativenumber = true
|
2021-07-07 04:08:00 -04:00
|
|
|
-- opt.numberwidth = 6
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- 4 spaces = 1 tab
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.tabstop = 4
|
|
|
|
opt.softtabstop = 4
|
|
|
|
opt.shiftwidth = 4
|
|
|
|
opt.smarttab = true
|
|
|
|
opt.expandtab = true
|
|
|
|
opt.smartindent = true
|
|
|
|
opt.autoindent = true
|
|
|
|
opt.shiftround = true
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Trailings, line break
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.list = true
|
|
|
|
opt.listchars = 'tab:»·,nbsp:+,trail:·,extends:→,precedes:←'
|
|
|
|
opt.showbreak = '↳ '
|
2021-07-08 17:27:02 -04:00
|
|
|
-- opt.linebreak = true
|
|
|
|
-- opt.breakat = [[\ \ ;:,!?]]
|
2021-07-04 15:03:20 -04:00
|
|
|
-- opt.breakindentopt = 'shift:4,min:20'
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
-- Undo file path
|
2021-07-04 15:03:20 -04:00
|
|
|
opt.undofile = true
|
|
|
|
opt.undodir = vim.fn.stdpath('cache') .. '/undodir'
|
2021-07-03 20:19:46 -04:00
|
|
|
end
|
|
|
|
|
2021-09-09 13:34:09 -04:00
|
|
|
return M
|