repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim/init.lua

Raw
-- A Neovim configuration, again...
--
-- ███     ▄     ▄▀  ██   ███   ▄█    ▄     ▄▀  ██
-- █  █     █  ▄▀    █ █  █  █  ██     █  ▄▀    █ █
-- █ ▀ ▄ █   █ █ ▀▄  █▄▄█ █ ▀ ▄ ██ ██   █ █ ▀▄  █▄▄█
-- █  ▄▀ █   █ █   █ █  █ █  ▄▀ ▐█ █ █  █ █   █ █  █
-- ███   █▄ ▄█  ███     █ ███    ▐ █  █ █  ███     █
--        ▀▀▀          █           █   ██         █
--                    ▀                          ▀

local version = vim.version()
local expected = { major = 0, minor = 11 }
if version.major ~= expected.major or version.minor ~= expected.minor then
	vim.notify(
		'This configuration assumes NeoVim version ' ..
		expected.major .. '.' .. expected.minor .. ', but it is ' .. version.major .. '.' .. version.minor .. '!',
		vim.log.levels.ERROR)
	return
end

-- setup debug mode
vim.g.bugabinga_debug_mode = false
-- start `profiler.nvim` with `NVIM_PROFILE=1 nvim ...` to instrument all modules,
-- but not start profiler yet.
-- or `NVIM_PROFILE=start nvim ...` to start the profiler on startup
-- then hit <F12> to save profile.
-- inspect profile on https://ui.perfetto.dev
require 'bugabinga.profile'

local start_time = vim.uv.hrtime()
local auto = require 'std.auto'
auto 'measure_startup_time' {
	events = 'VimEnter',
	description = 'Measure startup time of neovim.',
	once = true,
	command = function()
		local end_time = vim.uv.hrtime()
		local time_elapsed = end_time - start_time
		vim.schedule(function()
			local time_elapsed_ms = time_elapsed / 1e6
			local msg = string.format('Neovim started in (%d ms).', time_elapsed_ms)
			vim.notify(msg, vim.log.levels.INFO)
		end)
	end,
}

vim.cmd.colorscheme 'nugu'

require 'patches'

--[[ MY STUFF ]]
require 'bugabinga.bigfile'
require 'bugabinga.diagnostic'
require 'bugabinga.editorconfig'
require 'bugabinga.java'
require 'bugabinga.lsp'
require 'bugabinga.mkdir'
require 'bugabinga.options'
require 'bugabinga.sessions'
require 'bugabinga.treesitter'

--[[ PLUGINS ]]
require 'bugabinga.autotag'
require 'bugabinga.colorizer'
require 'bugabinga.devicons'
require 'bugabinga.diff'
require 'bugabinga.file_explorer'
require 'bugabinga.format'
require 'bugabinga.fuzzy_find'
require 'bugabinga.jump2d'
require 'bugabinga.key_preview'
require 'bugabinga.move'
require 'bugabinga.navigation'
require 'bugabinga.notifications'
require 'bugabinga.patterns'
require 'bugabinga.search_and_replace'
require 'bugabinga.specs'
require 'bugabinga.splitjoin'
require 'bugabinga.surround'
require 'bugabinga.terminal'
require 'bugabinga.textobjects'
require 'bugabinga.virtual_column'

require 'bugabinga.incubator'