repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim/lua/bugabinga/lazy.lua
Rawlocal win32 = vim.uv.os_uname().sysname:match 'Win'
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.uv.fs_stat( lazypath ) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend( lazypath )
-- prevents lazy from setting up its highlights.
-- those will be setup manually later.
require 'lazy.view.colors'.did_setup = true
local lazy = require 'lazy'
local icon = require 'std.icon'
local overrides = require 'std.localrc' ( '.lazy.specs.lua', 'table' )
lazy.setup {
spec = { { import = 'bugabinga.plugins' }, overrides },
defaults = {
lazy = true,
-- version = '*',
-- useful to globally disable plugins
cond = function ( plugin_spec )
return true
-- return plugin_spec.name:find 'virt'
end,
},
install = {
missing = true,
colorscheme = { 'nugu', 'quiet' },
},
checker = {
enabled = not win32,
notify = true,
},
ui = {
size = { width = 0.69, heigth = 0.69 },
border = vim.g.border_style,
icons = {
lazy = icon.lazy,
task = icon.terminal,
ft = icon.file,
},
},
change_detection = { notify = true },
performance = {
rtp = {
disabled_plugins = {
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
'gzip',
'zip',
'zipPlugin',
'tar',
'tarPlugin',
'getscript',
'getscriptPlugin',
'vimball',
'vimballPlugin',
'2html_plugin',
'logipat',
'rrhelper',
'spellfile_plugin',
'matchit',
'matchparen',
'man',
'tohtml',
'tutor',
},
},
},
dev = {
fallback = true,
patterns = { 'bugabinga' },
path = win32 and 'W:/' or '~/Workspace',
},
profiling = {
loader = false,
require = false,
},
}
local map = require 'std.map'
local lazy_cmds = vim.iter {
{ 'Show', '', lazy.show },
{ 'Install', 'i', lazy.install },
{ 'Update', 'u', lazy.update },
{ 'Sync', 's', lazy.sync },
{ 'Clean', 'x', lazy.clean },
{ 'Check', 'c', lazy.check },
{ 'Log', 'l', lazy.log },
{ 'Restore', 'r', lazy.restore },
{ 'Profile', 'p', lazy.profile },
{ 'Debug', 'd', lazy.debug },
}
local base_key = '<leader>z'
lazy_cmds:each( function ( cmd )
map.normal {
description = cmd[1],
category = 'plugins',
keys = base_key .. cmd[2],
command = cmd[3],
}
end )
local auto = require 'std.auto'
auto 'display_startup_time' {
description = 'Display startup time on starter screen',
events = 'User',
pattern = 'LazyVimStarted',
once = true,
command = vim.schedule_wrap( function ()
local startuptime = lazy.stats().startuptime
vim.notify( 'neovim started in ' .. startuptime .. 'ms' )
end ),
}