📦 Better Lazy Config

- Use proper directory structure
- Loading order improved
This commit is contained in:
2024-07-16 17:35:52 -04:00
parent d05d335464
commit 302817f9dd
5 changed files with 41 additions and 40 deletions
-2
View File
@@ -49,8 +49,6 @@
-- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Configuration ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-- --------------------------------- PRE-LOAD ----------------------------------
require("config.preload")
-- ---------------------------------- LAZY -------------------------------------
require("config.lazy")
+19
View File
@@ -0,0 +1,19 @@
-- -------------------------------- Commands -----------------------------------
-- Make :Q close all of the buffers
vim.api.nvim_create_user_command("Q", function()
vim.cmd.bdelete()
vim.cmd.qall()
end, { force = true })
-- ------------------------------ Auto-Commands --------------------------------
-- Autosave Colorscheme
vim.api.nvim_create_autocmd("ColorScheme", {
desc = "Store colorscheme name",
callback = function()
print("colorscheme:", vim.g.colors_name)
vim.fn.writefile(
{ vim.g.colors_name },
vim.fn.stdpath("config") .. "/.colorscheme"
)
end,
})
@@ -2,26 +2,6 @@
-- -------------------------------- KEYBINDS -----------------------------------
-- -----------------------------------------------------------------------------
-- -------------------------------- Commands -----------------------------------
-- Make :Q close all of the buffers
vim.api.nvim_create_user_command("Q", function()
vim.cmd.bdelete()
vim.cmd.qall()
end, { force = true })
-- ------------------------------ Auto-Commands --------------------------------
-- Autosave Colorscheme
vim.api.nvim_create_autocmd("ColorScheme", {
desc = "Store colorscheme name",
callback = function()
print("colorscheme:", vim.g.colors_name)
vim.fn.writefile(
{ vim.g.colors_name },
vim.fn.stdpath("config") .. "/.colorscheme"
)
end,
})
-- --------------------------------- Keymaps -----------------------------------
local wk = require("which-key")
wk.add({
@@ -1,8 +1,10 @@
-- -----------------------------------------------------------------------------
-- -------------------------------- PRE-LOAD -----------------------------------
-- --------------------------------- OPTIONS -----------------------------------
-- -----------------------------------------------------------------------------
-- Set Default Leader Key
vim.g.mapleader = " "
-- Restore Leader Key
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.leader") == 1 then
-- Load Stored Leader Key
@@ -19,3 +21,13 @@ else
KITTY_THEME = os.getenv("KITTY_THEME")
end
end
-- ----------------------------------- LSP --------------------------------------
vim.g.loaded_perl_provider = 0
vim.g.lazyvim_python_lsp = "basedpyright"
-- ------------------------------- CLIENT APPS ---------------------------------
if vim.g.neovide then
-- ----------------------- Neovide -------------------------
require("config.neovide")
end
+9 -17
View File
@@ -1,20 +1,12 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- OPTIONS -----------------------------------
-- ---------------------------------- USER -------------------------------------
-- -----------------------------------------------------------------------------
-- ----------------------------------- LSP --------------------------------------
vim.g.loaded_perl_provider = 0
vim.g.lazyvim_python_lsp = "basedpyright"
-- ---------------------------------- STYLE ------------------------------------
-- Apply the colorscheme
vim.cmd.colorscheme(STORED_THEME or KITTY_THEME or "catppuccin-frappe")
-- ------------------------------- CLIENT APPS ---------------------------------
if vim.g.neovide then
-- ----------------------- Neovide -------------------------
require("config.neovide")
end
-- -------------------------------- KEYBINDS -----------------------------------
require("config.keybinds")
----------- Apply the colorscheme -----------
-- 1. Restore last colorscheme if it exists
-- 2. Use kitty theme if it exists
-- 3. Fallback to Catppuccin Frappe
-- 4. Fallback to Tokyonight
vim.cmd.colorscheme(
STORED_THEME or KITTY_THEME or "catppuccin-frappe" or "tokyonight"
)