Optimized startup w/ async and global vars

This commit is contained in:
Just Midi 2021-08-11 19:19:02 +00:00
parent 5f8478fd6f
commit f77096be5e
5 changed files with 92 additions and 55 deletions

View file

@ -1,3 +1,40 @@
require('general')
require('keymap')
require('ui')
-- see `:help` for any questions
-- use `&<var>` to show value of vimscript variable
-- API --
o = vim.o -- options
go = vim.go -- only-global options
bo = vim.bo -- buffer local options
wo = vim.wo -- window local options
cmd = vim.cmd -- vim commands
fn = vim.fn -- vim functions
opt = vim.opt -- vim option object
g = vim.g -- global variables
b = vim.b -- buffer local variables
w = vim.w -- window local variables
t = vim.t -- tab local variables
v = vim.v -- variables
env = vim.env -- environment variables
local modules = {
'general',
'keymap',
'ui',
'native-lsp'
}
local async
async = vim.loop.new_async(
vim.schedule_wrap(
function()
for i = 1, #modules, 1 do
pcall(require, modules[i])
end
async:close()
end
)
)
async:send()

View file

@ -3,21 +3,21 @@
-- API --
local o = vim.o -- options
local go = vim.go -- only-global options
local bo = vim.bo -- buffer local options
local wo = vim.wo -- window local options
-- o = vim.o -- options
-- go = vim.go -- only-global options
-- bo = vim.bo -- buffer local options
-- wo = vim.wo -- window local options
local cmd = vim.cmd -- vim commands
local fn = vim.fn -- vim functions
local opt = vim.opt -- vim option object
-- cmd = vim.cmd -- vim commands
-- fn = vim.fn -- vim functions
-- opt = vim.opt -- vim option object
local g = vim.g -- global variables
local b = vim.b -- buffer local variables
local w = vim.w -- window local variables
local t = vim.t -- tab local variables
local v = vim.v -- variables
local env = vim.env -- environment variables
-- g = vim.g -- global variables
-- b = vim.b -- buffer local variables
-- w = vim.w -- window local variables
-- t = vim.t -- tab local variables
-- v = vim.v -- variables
-- env = vim.env -- environment variables
vim.g.mapleader = ' '

View file

@ -4,21 +4,21 @@
require('keymap/functional')
-- API --
local o = vim.o -- options
local go = vim.go -- only-global options
local bo = vim.bo -- buffer local options
local wo = vim.wo -- window local options
-- o = vim.o -- options
-- go = vim.go -- only-global options
-- bo = vim.bo -- buffer local options
-- wo = vim.wo -- window local options
local cmd = vim.cmd -- vim commands
local fn = vim.fn -- vim functions
local opt = vim.opt -- vim option object
-- cmd = vim.cmd -- vim commands
-- fn = vim.fn -- vim functions
-- opt = vim.opt -- vim option object
local g = vim.g -- global variables
local b = vim.b -- buffer local variables
local w = vim.w -- window local variables
local t = vim.t -- tab local variables
local v = vim.v -- variables
local env = vim.env -- environment variables
-- g = vim.g -- global variables
-- b = vim.b -- buffer local variables
-- w = vim.w -- window local variables
-- t = vim.t -- tab local variables
-- v = vim.v -- variables
-- env = vim.env -- environment variables
local layouts = {

View file

@ -4,21 +4,21 @@
require('ui/statusbar')
-- API --
local o = vim.o -- options
local go = vim.go -- only-global options
local bo = vim.bo -- buffer local options
local wo = vim.wo -- window local options
-- o = vim.o -- options
-- go = vim.go -- only-global options
-- bo = vim.bo -- buffer local options
-- wo = vim.wo -- window local options
local cmd = vim.cmd -- vim commands
local fn = vim.fn -- vim functions
local opt = vim.opt -- vim option object
-- cmd = vim.cmd -- vim commands
-- fn = vim.fn -- vim functions
-- opt = vim.opt -- vim option object
local g = vim.g -- global variables
local b = vim.b -- buffer local variables
local w = vim.w -- window local variables
local t = vim.t -- tab local variables
local v = vim.v -- variables
local env = vim.env -- environment variables
-- g = vim.g -- global variables
-- b = vim.b -- buffer local variables
-- w = vim.w -- window local variables
-- t = vim.t -- tab local variables
-- v = vim.v -- variables
-- env = vim.env -- environment variables

View file

@ -2,21 +2,21 @@
-- use `&<var>` to show value of vimscript variable
-- API --
local o = vim.o -- options
local go = vim.go -- only-global options
local bo = vim.bo -- buffer local options
local wo = vim.wo -- window local options
-- o = vim.o -- options
-- go = vim.go -- only-global options
-- bo = vim.bo -- buffer local options
-- wo = vim.wo -- window local options
local cmd = vim.cmd -- vim commands
local fn = vim.fn -- vim functions
local opt = vim.opt -- vim option object
-- cmd = vim.cmd -- vim commands
-- fn = vim.fn -- vim functions
-- opt = vim.opt -- vim option object
local g = vim.g -- global variables
local b = vim.b -- buffer local variables
local w = vim.w -- window local variables
local t = vim.t -- tab local variables
local v = vim.v -- variables
local env = vim.env -- environment variables
-- g = vim.g -- global variables
-- b = vim.b -- buffer local variables
-- w = vim.w -- window local variables
-- t = vim.t -- tab local variables
-- v = vim.v -- variables
-- env = vim.env -- environment variables
--Later generalize into plugin