BREAKING CHANGE | re-implementation of custom config
This commit is contained in:
parent
d906bb0d9c
commit
adecbe719f
20 changed files with 835 additions and 1309 deletions
|
|
@ -1,31 +1,34 @@
|
|||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
local options = require("core.utils").load_config().options
|
||||
-- use filetype.lua instead of filetype.vim
|
||||
g.did_load_filetypes = 0
|
||||
g.do_filetype_lua = 1
|
||||
|
||||
opt.laststatus = 3 -- global statusline
|
||||
opt.title = true
|
||||
opt.clipboard = options.clipboard
|
||||
opt.cmdheight = options.cmdheight
|
||||
opt.clipboard = "unnamedplus"
|
||||
opt.cmdheight = 1
|
||||
opt.cul = true -- cursor line
|
||||
|
||||
-- Indentline
|
||||
opt.expandtab = options.expandtab
|
||||
opt.shiftwidth = options.shiftwidth
|
||||
opt.smartindent = options.smartindent
|
||||
opt.expandtab = true
|
||||
opt.shiftwidth = 2
|
||||
opt.smartindent = true
|
||||
|
||||
-- disable tilde on end of buffer: https://github.com/neovim/neovim/pull/8546#issuecomment-643643758
|
||||
opt.fillchars = options.fillchars
|
||||
opt.fillchars = { eob = " " }
|
||||
|
||||
opt.hidden = options.hidden
|
||||
opt.ignorecase = options.ignorecase
|
||||
opt.smartcase = options.smartcase
|
||||
opt.mouse = options.mouse
|
||||
opt.hidden = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.mouse = "a"
|
||||
|
||||
-- Numbers
|
||||
opt.number = options.number
|
||||
opt.numberwidth = options.numberwidth
|
||||
opt.relativenumber = options.relativenumber
|
||||
opt.ruler = options.ruler
|
||||
opt.number = true
|
||||
opt.numberwidth = 2
|
||||
opt.relativenumber = false
|
||||
opt.ruler = false
|
||||
|
||||
-- disable nvim intro
|
||||
opt.shortmess:append "sI"
|
||||
|
|
@ -33,31 +36,54 @@ opt.shortmess:append "sI"
|
|||
opt.signcolumn = "yes"
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.tabstop = options.tabstop
|
||||
opt.tabstop = 8
|
||||
opt.termguicolors = true
|
||||
opt.timeoutlen = options.timeoutlen
|
||||
opt.undofile = options.undofile
|
||||
opt.timeoutlen = 400
|
||||
opt.undofile = true
|
||||
|
||||
-- interval for writing swap file to disk, also used by gitsigns
|
||||
opt.updatetime = options.updatetime
|
||||
opt.updatetime = 250
|
||||
|
||||
-- go to previous/next line with h,l,left arrow and right arrow
|
||||
-- when cursor reaches end/beginning of line
|
||||
opt.whichwrap:append "<>[]hl"
|
||||
|
||||
g.mapleader = options.mapleader
|
||||
g.mapleader = " "
|
||||
|
||||
-- disable some builtin vim plugins
|
||||
local disabled_built_ins = require("core.utils").load_config().plugins.builtins
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
local default_plugins = {
|
||||
"2html_plugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(default_plugins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
--Defer loading shada until after startup_
|
||||
vim.opt.shadafile = "NONE"
|
||||
|
||||
vim.schedule(function()
|
||||
vim.opt.shadafile = require("core.utils").load_config().options.shadafile
|
||||
vim.opt.shadafile = "NONE"
|
||||
vim.cmd [[ silent! rsh ]]
|
||||
end)
|
||||
|
||||
-- load user options if the file exists
|
||||
|
||||
local load_ifExists = require("core.utils").load_ifExists
|
||||
local user_options = require("core.utils").load_config().options.path
|
||||
|
||||
load_ifExists(user_options)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue