forked from doom-neovim/doom-nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
57 lines (49 loc) · 2.07 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---[[---------------------------------------]]---
-- init.lua - Init file of Doom Nvim --
-- Author: NTBBloodbath --
-- License: GPLv2 --
---[[---------------------------------------]]---
---- Doom Utilities -----------------------------
-------------------------------------------------
-- Store startup time in seconds
vim.g.start_time = vim.fn.reltime()
-- Lua modules loader, when loading our modules with this
-- we avoid breaking all the configuration if something fails
local load_modules = require("doom.utils.modules").load_modules
-- Disable some unused built-in Neovim plugins
vim.g.loaded_gzip = false
vim.g.loaded_tarPlugin = false
vim.g.loaded_zipPlugin = false
vim.g.loaded_2html_plugin = false
---- Doom Configurations ------------------------
-------------------------------------------------
-- Load Doom core and UI related stuff (colorscheme, background)
load_modules("doom", { "core" })
-- Defer and schedule loading of plugins and extra functionalities until the
-- Neovim API functions are safe to call to avoid weird errors with plugins stuff
vim.defer_fn(function()
-- Load Doom extra stuff and plugins (modules, extras)
load_modules("doom", { "modules", "extras" })
-- This loads certain plugins related to UI
vim.cmd("doautocmd ColorScheme")
-- If the current buffer name is empty then trigger Dashboard.
-- NOTE: this is done to avoid some weird issues with Dashboard and
-- number / signcolumn when Dashboard gets triggered automatically
if
(packer_plugins and packer_plugins["dashboard-nvim"])
and (vim.api.nvim_buf_get_number(0) > 1 or vim.api.nvim_buf_get_lines(0, 0, 1, false)[1]:len() == 0)
and vim.api.nvim_buf_get_name(0):len() == 0 -- Empty buffer name
then
vim.cmd("Dashboard")
end
vim.cmd([[
PackerLoad nvim-treesitter
" This BufEnter call should fix some issues with concealing in neorg
doautocmd BufEnter
]])
if not require("doom.utils").is_plugin_disabled("which-key") then
vim.cmd([[
PackerLoad which-key.nvim
]])
end
end, 0)