♻️ refactor(full-scope)!: major revision refactoring
Code layout has been changed and improoved. Annotations are added for documentation. Automated through utility functions and data tables BREAKING CHANGE: Tested from clean. Now properly uses LuaRocks to install dependencies.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
--- @module "config.autocmds"
|
||||
--- This module defines the autocommands for the Neovim configuration.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Autocommands │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
@@ -52,6 +54,18 @@ autocmd({ "BufEnter", "FocusGained" }, {
|
||||
end,
|
||||
})
|
||||
|
||||
-- TodoFzfLua command override to use Telescope
|
||||
-- when fzf-lua is not installed
|
||||
autogrp("TodoFzfLua", { clear = true })
|
||||
autocmd({ "BufEnter" }, {
|
||||
group = "TodoFzfLua",
|
||||
callback = function()
|
||||
if not pcall(require, "fzf-lua") then
|
||||
vim.cmd([[command! -nargs=* TodoFzfLua :TodoTelescope]])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set up autocommands and highlight settings
|
||||
local load_highlight = require("utils.highlight")
|
||||
load_highlight.setup_autocommands()
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
--- @module "config.keymaps"
|
||||
--- This module defines the keymapping operations for the Neovim configuration.
|
||||
--- The actual keybindings are defined in lua/data/keys.lua
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Keybinds │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
+24
-10
@@ -1,8 +1,9 @@
|
||||
---@module "config.lazy"
|
||||
--- This module bootstraps Lazy.nvim.
|
||||
--- Lazy is a plugin manager for Neovim.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Lazy │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
---@module "config.lazy"
|
||||
--- Bootstrap the lazy.nvim plugin manager
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
-- stylua: ignore
|
||||
@@ -17,14 +18,28 @@ end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ PLUGINS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
import = "lazyvim.plugins",
|
||||
},
|
||||
{ import = "plugins" }, -- General Plugins
|
||||
|
||||
local plugin_specs = {
|
||||
{
|
||||
"LazyVim/LazyVim", -- LazyVim
|
||||
import = "lazyvim.plugins", -- LazyVim Core Plugins
|
||||
},
|
||||
{ import = "plugins" }, -- General Plugins
|
||||
}
|
||||
|
||||
-- Automatically import all subdirectories of `lua/plugins`
|
||||
local plugin_dirs = vim.fn.glob("~/.config/nvim/lua/plugins/*", true, true)
|
||||
for _, dir in ipairs(plugin_dirs) do
|
||||
if vim.fn.isdirectory(dir) == 1 then
|
||||
table.insert( -- Add directory to the plugin import table
|
||||
plugin_specs,
|
||||
{ import = "plugins." .. vim.fn.fnamemodify(dir, ":t") }
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
require("lazy").setup({
|
||||
spec = plugin_specs,
|
||||
defaults = {
|
||||
lazy = false,
|
||||
version = false,
|
||||
@@ -44,7 +59,6 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
profiling = {
|
||||
-- Track the time spent loading plugins
|
||||
loader = true,
|
||||
require = true,
|
||||
},
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
--- @module "config.neovide"
|
||||
--- This module defines the neovide options for the Neovim configuration.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Neovide │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
+62
-32
@@ -1,41 +1,78 @@
|
||||
--- @module "config.options"
|
||||
--- This module defines the user options for the Neovim configuration.
|
||||
--- Variables defined here set configuration options for the rest
|
||||
--- of the Neovim configuration.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Options │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
-- stylua: ignore start
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Leader Key ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.mapleader = " " --- @type string Options: <leader>
|
||||
vim.g.maplocalleader = " " --- @type string Options: <localleader>
|
||||
vim.g.mapleader = " " ---@type string Options: <leader>
|
||||
vim.g.maplocalleader = " " ---@type string Options: <localleader>
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ LSP ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- We don't need perl
|
||||
vim.g.loaded_perl_provider = 0 --- @type integer Options: <0|1>
|
||||
vim.g.loaded_ruby_provider = 0 --- @type integer Options: <0|1>
|
||||
vim.g.loaded_perl_provider = 0 ---@type integer Options: <0|1>
|
||||
vim.g.loaded_ruby_provider = 0 ---@type integer Options: <0|1>
|
||||
-- Prefer basedpyright
|
||||
vim.g.lazyvim_python_lsp = "basedpyright" --- @type string Options: [python lsp]
|
||||
vim.g.lazyvim_python_lsp = "basedpyright" ---@type string Options: [python lsp]
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Check if we are on windows
|
||||
vim.g.is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ROOTIEST ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- ╭───────────────────────────╮ Options:
|
||||
-- │ │ codeium
|
||||
-- │ AI Tools: │ copilot
|
||||
-- │ Choose an AI provider │ tabnine
|
||||
-- │ from the list │ minuet
|
||||
-- │ │ ollama
|
||||
-- ╰───────────────────────────╯ none
|
||||
vim.g.aitool = "codeium" --- @type string Options: [ai tool]
|
||||
vim.g.usewakatime = true ---@type boolean Options: <true|false>
|
||||
vim.g.usemusic = true ---@type boolean Options: <true|false>
|
||||
vim.g.usehardtime = false ---@type boolean Options: <true|false>
|
||||
vim.g.useimage = true ---@type boolean Options: <true|false>
|
||||
vim.g.ignore_no_lazy = false ---@type boolean Options: <true|false>
|
||||
vim.g.codesnap = true ---@type boolean Options: <true|false>
|
||||
vim.g.auto_cursorline = true ---@type boolean Options: <true|false>
|
||||
vim.g.auto_save = true ---@type boolean Options: <true|false>
|
||||
|
||||
vim.g.usewakatime = true --- @type boolean Options: <true|false>
|
||||
vim.g.usehardtime = false --- @type boolean Options: <true|false>
|
||||
vim.g.useimage = true --- @type boolean Options: <true|false>
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ AI TOOL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.aitool = "codeium" ---@type string Options: [ai tool]
|
||||
-- ╭───────────────────────────╮ codeium
|
||||
-- │ │ copilot
|
||||
-- │ AI Tools: │ tabnine
|
||||
-- │ Choose an AI provider │ minuet
|
||||
-- │ from the list │ ollama
|
||||
-- │ │ none
|
||||
-- ╰───────────────────────────╯
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Lualine Stats ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.stats_wakatime = true --- @type boolean Options: <true|false>
|
||||
vim.g.stats_music = true --- @type boolean Options: <true|false>
|
||||
vim.g.stats_ignored_players = { --- @type string[] Options: [ignored players]
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STATUS LINE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.statusline = "lualine" ---@type string Options: [statusline]
|
||||
-- ╭───────────────────────────╮ lualine
|
||||
-- │ │ heirline
|
||||
-- │ Status Lines: │ basic
|
||||
-- │ Choose a plugin from │ none
|
||||
-- │ the list │
|
||||
-- │ │
|
||||
-- ╰───────────────────────────╯
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STATUS COLUMN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.statuscolumn = "native" ---@type string Options: [statuscolumn]
|
||||
-- ╭───────────────────────────╮ barsNlines
|
||||
-- │ │ native
|
||||
-- │ Status Columns: │
|
||||
-- │ Choose a plugin from │
|
||||
-- │ the list │
|
||||
-- │ │
|
||||
-- ╰───────────────────────────╯
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BUFFER LINE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
vim.g.tabline = "bufferline" ---@type string Options: [tabline]
|
||||
-- ╭───────────────────────────╮ bufferline
|
||||
-- │ │ barsNlines
|
||||
-- │ Tab Lines: │ none
|
||||
-- │ Choose a plugin from │
|
||||
-- │ the list │
|
||||
-- │ │
|
||||
-- ╰───────────────────────────╯
|
||||
vim.g.statusline_clickable_git = false ---@type boolean Options: <true|false>
|
||||
vim.g.stats_wakatime = true ---@type boolean Options: <true|false>
|
||||
vim.g.stats_music = true ---@type boolean Options: <true|false>
|
||||
vim.g.stats_ignored_players = { ---@type string[] Options: [ignored players]
|
||||
"chromium",
|
||||
"firefox",
|
||||
"kdeconnect",
|
||||
@@ -46,20 +83,13 @@ vim.g.stats_ignored_players = { --- @type string[] Options: [ignored players]
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ COLOR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Background color
|
||||
vim.o.background = "dark" --- @type string Options: <dark|light>
|
||||
vim.o.background = "dark" ---@type string Options: <dark|light>
|
||||
-- Dashboard header color
|
||||
vim.g.DashboardHeaderColor = "#88fc9a" --- @type string Options: [hex color]
|
||||
vim.g.DashboardHeaderColor = "#88fc9a"---@type string Options: [hex color]
|
||||
-- Disable Transparency
|
||||
vim.g.disable_transparency = true --- @type boolean Options: <true|false>
|
||||
vim.g.disable_transparency = true ---@type boolean Options: <true|false>
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ BLINKY CURSOR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Setup the blinky cursor
|
||||
require("utils.blinky").enable()
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OTHER ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Suda smart edit: Automatically edit files in sudo mode when needed
|
||||
vim.g.suda_smart_edit = 1 --- @type integer Options: <0|1>
|
||||
vim.cmd("let g:suda#prompt = ' Enter Sudo Password '")
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Completion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Cmp Window Border
|
||||
vim.g.completion_round_borders_enabled = true
|
||||
vim.g.completion_round_borders_enabled = true ---Options: <true|false>
|
||||
-- stylua: ignore end
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
--- @module "config.profile"
|
||||
--- This module configures the profiler for the Neovim configuration.
|
||||
--- This tool can be used to profile specific modules or all modules.
|
||||
---
|
||||
--- The profiler can be toggled with the leader keybinding `d<f1>`
|
||||
--- or with the `NVIM_PROFILE` environment variable.
|
||||
---
|
||||
--- Specific modules can be selected with the `NVIM_PROFILE_MODULE`
|
||||
--- environment variable.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ PROFILER │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
+27
-1
@@ -1,6 +1,10 @@
|
||||
--- @module "config.rocks"
|
||||
--- This module bootstraps rocks.nvim.
|
||||
--- Rocks is a package manager for Neovim.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ ROCKS │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
local M = {}
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Bootstrap rocks.nvim ━━━━━━━━━━━━━━━━━━━━━
|
||||
do
|
||||
@@ -73,5 +77,27 @@ if not pcall(require, "rocks") then
|
||||
vim.fn.delete(rocks_location, "rf")
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Rocks plugin spec ━━━━━━━━━━━━━━━━━━━━━━
|
||||
M.plugin_spec = {
|
||||
"vhyrro/luarocks.nvim",
|
||||
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
|
||||
opts = {
|
||||
rocks = { "magick" }, -- specifies a list of rocks to install
|
||||
},
|
||||
}
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Load plugins ━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
require("rocks")
|
||||
-- Load rocks package manager
|
||||
M.load_rocks = function()
|
||||
require("rocks")
|
||||
end
|
||||
|
||||
-- Perform setup
|
||||
M.setup = function()
|
||||
M.load_rocks()
|
||||
end
|
||||
|
||||
-- Execute the setup function
|
||||
M.setup()
|
||||
|
||||
return M
|
||||
|
||||
+15
-3
@@ -1,5 +1,6 @@
|
||||
---@module "config.rootiest"
|
||||
--- This module contains the configuration for the rootiest distro.
|
||||
--- This module contains the configuration options and functions
|
||||
--- for the rootiest distro.
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Rootiest Module │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
@@ -83,10 +84,13 @@ function M.toggle_lazygit_float(my_args)
|
||||
if my_args ~= "" or my_args ~= nil then
|
||||
Util.terminal.open(
|
||||
{ "lazygit", my_args },
|
||||
{ cwd = Util.root(), esc_esc = false }
|
||||
{ cwd = Util.root(), interactive = true, esc_esc = false }
|
||||
)
|
||||
else
|
||||
Util.terminal.open({ "lazygit" }, { cwd = Util.root(), esc_esc = false })
|
||||
Util.terminal.open(
|
||||
{ "lazygit" },
|
||||
{ cwd = Util.root(), interactive = true, esc_esc = false }
|
||||
)
|
||||
end
|
||||
return true
|
||||
else
|
||||
@@ -191,6 +195,14 @@ function M.setup()
|
||||
|
||||
-- Setup Rootiest cmd window (override default command-line behavior)
|
||||
-- require("utils.cmd_window").setup({ override_cmdline = true })
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ BLINKY CURSOR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Setup the blinky cursor if it is enabled
|
||||
if vim.g.blinky ~= false then
|
||||
require("utils").blinky.enable()
|
||||
else
|
||||
require("utils").blinky.disable()
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user