refactor: simplify data variable usage across multiple modules

This commit is contained in:
2024-08-24 16:32:29 -04:00
parent ac9397a703
commit c02ba52ff1
8 changed files with 59 additions and 54 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ AI Tools │ -- │ AI Tools │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ {
-- Neocodeium -- Neocodeium
@@ -11,7 +13,7 @@ return {
silent = true, silent = true,
debounce = false, debounce = false,
}, },
keys = require("data.keys").neocodeium, keys = data.keys.neocodeium,
}, },
{ -- Copilot { -- Copilot
import = "lazyvim.plugins.extras.coding.copilot", import = "lazyvim.plugins.extras.coding.copilot",
+3 -1
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Auto Completion │ -- │ Auto Completion │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
@@ -153,7 +155,7 @@ return {
}) })
-- List of filetypes to disable completion -- List of filetypes to disable completion
local disabled_filetypes = require("data.types").cmp local disabled_filetypes = data.types.cmp
for _, filetype in ipairs(disabled_filetypes) do for _, filetype in ipairs(disabled_filetypes) do
cmp.setup.filetype(filetype, { cmp.setup.filetype(filetype, {
sources = {}, sources = {},
+7 -13
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Coding │ -- │ Coding │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ -- Mason-lspconfig { -- Mason-lspconfig
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
@@ -17,14 +19,6 @@ return {
{ -- VSCode { -- VSCode
import = "lazyvim.plugins.extras.vscode", import = "lazyvim.plugins.extras.vscode",
}, },
{ -- Ollama Copilot
"Faywyn/llama-copilot.nvim",
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = require("data.types").ollama_copilot,
},
{ -- G-code { -- G-code
"wilriker/gcode.vim", "wilriker/gcode.vim",
}, },
@@ -38,8 +32,8 @@ return {
{ -- Alternate { -- Alternate
"ton/vim-alternate", "ton/vim-alternate",
lazy = true, lazy = true,
ft = require("data.types").alternate, ft = data.types.alternate,
keys = require("data.keys").alternate, keys = data.keys.alternate,
}, },
{ -- Highlight colors { -- Highlight colors
"brenoprata10/nvim-highlight-colors", "brenoprata10/nvim-highlight-colors",
@@ -57,14 +51,14 @@ return {
{ -- Substitute { -- Substitute
"gbprod/substitute.nvim", "gbprod/substitute.nvim",
lazy = true, lazy = true,
opts = require("data.types").substitute, opts = data.types.substitute,
keys = require("data.keys").substitute, keys = data.keys.substitute,
}, },
{ -- mini.splitjoin { -- mini.splitjoin
"echasnovski/mini.splitjoin", "echasnovski/mini.splitjoin",
event = "InsertEnter", event = "InsertEnter",
opts = { opts = {
mappings = require("data.keys").splitjoin, mappings = data.keys.splitjoin,
}, },
}, },
} }
+3 -1
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Core │ -- │ Core │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ -- LazyVim { -- LazyVim
"LazyVim/LazyVim", "LazyVim/LazyVim",
@@ -18,7 +20,7 @@ return {
{ -- Bufferline { -- Bufferline
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
opts = { opts = {
options = require("data.types").bufferline, options = data.types.bufferline,
}, },
}, },
{ -- Which-Key { -- Which-Key
+3 -1
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Dashboard │ -- │ Dashboard │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
-- Dashboard -- Dashboard
enabled = false, enabled = false,
@@ -62,7 +64,7 @@ return {
file_height = logo_dimensions.height, file_height = logo_dimensions.height,
}, },
config = { config = {
center = require("data.dash").choices, center = data.dash.choices,
footer = function() footer = function()
local stats = require("lazy").stats() local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
+9 -7
View File
@@ -1,6 +1,8 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Editor │ -- │ Editor │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ -- Aerial { -- Aerial
import = "lazyvim.plugins.extras.editor.aerial", import = "lazyvim.plugins.extras.editor.aerial",
@@ -25,7 +27,7 @@ return {
}, },
{ -- Arrow { -- Arrow
"otavioschwanck/arrow.nvim", "otavioschwanck/arrow.nvim",
opts = require("data.types").arrow, opts = data.types.arrow,
}, },
{ -- indent-blankline { -- indent-blankline
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
@@ -34,16 +36,16 @@ return {
{ -- FoldNav { -- FoldNav
"domharries/foldnav.nvim", "domharries/foldnav.nvim",
lazy = true, lazy = true,
keys = require("data.keys").foldnav, keys = data.keys.foldnav,
}, },
---@module "neominimap.config.meta" ---@module "neominimap.config.meta"
{ -- NeoMiniMap { -- NeoMiniMap
"Isrothy/neominimap.nvim", "Isrothy/neominimap.nvim",
enabled = true, enabled = true,
lazy = false, lazy = false,
keys = require("data.keys").minimap, keys = data.keys.minimap,
init = require("data.types").minimap.init(), init = data.types.minimap.init(),
cond = require("data.types").minimap.cond(), cond = data.types.minimap.cond(),
}, },
{ -- Persistence { -- Persistence
"folke/persistence.nvim", "folke/persistence.nvim",
@@ -58,13 +60,13 @@ return {
"tris203/precognition.nvim", "tris203/precognition.nvim",
lazy = true, lazy = true,
opts = {}, opts = {},
keys = require("data.keys").precog, keys = data.keys.precog,
}, },
{ -- Zen Mode { -- Zen Mode
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
lazy = true, lazy = true,
opts = {}, opts = {},
keys = require("data.keys").zen, keys = data.keys.zen,
}, },
{ -- SmoothCursor { -- SmoothCursor
"gen740/SmoothCursor.nvim", "gen740/SmoothCursor.nvim",
+16 -15
View File
@@ -1,6 +1,7 @@
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Git Plugins │ -- │ Git Plugins │
-- ╰─────────────────────────────────────────────────────────╯ -- ╰─────────────────────────────────────────────────────────╯
local data = require("data")
return { return {
{ -- Git UI { -- Git UI
@@ -12,20 +13,20 @@ return {
{ -- DiffView { -- DiffView
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").diffview, cmd = data.cmd.diffview,
}, },
{ -- Gist Tools { -- Gist Tools
"Rawnly/gist.nvim", "Rawnly/gist.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").gist, cmd = data.cmd.gist,
keys = require("data.keys").gist, keys = data.keys.gist,
config = true, config = true,
}, },
{ -- LazyGit { -- LazyGit
"kdheepak/lazygit.nvim", "kdheepak/lazygit.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").lazygit, cmd = data.cmd.lazygit,
keys = require("data.keys").lazygit, keys = data.keys.lazygit,
dependencies = { dependencies = {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
@@ -37,7 +38,7 @@ return {
{ -- Thanks/github-stars { -- Thanks/github-stars
"jsongerber/thanks.nvim", "jsongerber/thanks.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").thanks, cmd = data.cmd.thanks,
opts = { opts = {
star_on_install = false, star_on_install = false,
}, },
@@ -45,9 +46,9 @@ return {
{ -- GitLinker { -- GitLinker
"linrongbin16/gitlinker.nvim", "linrongbin16/gitlinker.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").gitlinker, cmd = data.cmd.gitlinker,
opts = {}, opts = {},
keys = require("data.keys").gitlinker, keys = data.keys.gitlinker,
}, },
{ -- Git Blame { -- Git Blame
"f-person/git-blame.nvim", "f-person/git-blame.nvim",
@@ -71,16 +72,16 @@ return {
-- Apply the lualine configuration -- Apply the lualine configuration
require("lualine").setup(config) require("lualine").setup(config)
-- Return the git-blame options -- Return the git-blame options
return require("data.types").gitblame return data.types.gitblame
end, end,
}, },
{ -- Git Graph { -- Git Graph
"isakbm/gitgraph.nvim", "isakbm/gitgraph.nvim",
opts = { opts = {
symbols = require("data.types").gitgraph.symbols(), symbols = data.types.gitgraph.symbols(),
format = { format = {
timestamp = require("data.types").gitgraph.timestamp, timestamp = data.types.gitgraph.timestamp,
fields = require("data.types").gitgraph.fields, fields = data.types.gitgraph.fields,
}, },
hooks = { hooks = {
-- Check diff of a commit -- Check diff of a commit
@@ -95,7 +96,7 @@ return {
end, end,
}, },
}, },
keys = require("data.keys").gitgraph, keys = data.keys.gitgraph,
}, },
{ -- FuGit { -- FuGit
"SuperBo/fugit2.nvim", "SuperBo/fugit2.nvim",
@@ -110,7 +111,7 @@ return {
dependencies = { "stevearc/dressing.nvim" }, dependencies = { "stevearc/dressing.nvim" },
}, },
}, },
cmd = require("data.cmd").fugit, cmd = data.cmd.fugit,
keys = require("data.keys").fugit, keys = data.keys.fugit,
}, },
} }
+15 -15
View File
@@ -10,15 +10,17 @@ package.path = package.path
.. vim.fn.expand("$HOME") .. vim.fn.expand("$HOME")
.. "/.luarocks/share/lua/5.1/?.lua" .. "/.luarocks/share/lua/5.1/?.lua"
local data = require("data")
return { return {
{ -- Smart-Splits { -- Smart-Splits
"mrjones2014/smart-splits.nvim", "mrjones2014/smart-splits.nvim",
lazy = false, lazy = false,
build = "./kitty/install-kittens.bash", build = data.types.smart_splits.build(),
}, },
{ -- Image Renderer { -- Image Renderer
"3rd/image.nvim", "3rd/image.nvim",
ft = require("data.types").image, ft = data.types.image,
config = function() config = function()
require("image").setup() require("image").setup()
end, end,
@@ -27,51 +29,49 @@ return {
{ -- ToggleTerm { -- ToggleTerm
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
event = "VeryLazy", event = "VeryLazy",
keys = require("data.keys").toggleterm, keys = data.keys.toggleterm,
config = function() config = function()
require("toggleterm").setup(require("data.types").toggleterm) require("toggleterm").setup(data.types.toggleterm)
end, end,
}, },
{ -- Kitty-Runner { -- Kitty-Runner
"jghauser/kitty-runner.nvim", "jghauser/kitty-runner.nvim",
cond = require("data.func").is_kitty(), cond = data.func.is_kitty(),
}, },
{ -- Kitty-Scrollback { -- Kitty-Scrollback
"mikesmithgh/kitty-scrollback.nvim", "mikesmithgh/kitty-scrollback.nvim",
enabled = true, enabled = true,
lazy = true, lazy = true,
cmd = require("data.cmd").kitty_scrollback, cmd = data.cmd.kitty_scrollback,
event = { "User KittyScrollbackLaunch" }, event = { "User KittyScrollbackLaunch" },
version = "*", version = "*",
config = function() -- Using Kitty-Scrollback config = function() -- Using Kitty-Scrollback
if vim.env.KITTY_SCROLLBACK_NVIM == "true" then if data.func.is_kitty_scrollback() then
require("kitty-scrollback").setup() require("kitty-scrollback").setup()
end end
end, end,
cond = data.func.is_kitty_scrollback(),
}, },
{ -- Nekifoch { -- Nekifoch
"NeViRAIDE/nekifoch.nvim", "NeViRAIDE/nekifoch.nvim",
lazy = true, lazy = true,
cmd = require("data.cmd").nekifoch, cmd = data.cmd.nekifoch,
opts = { opts = {
kitty_conf_path = vim.env.HOME .. "/.kittyoverrides", kitty_conf_path = vim.env.HOME .. "/.kittyoverrides",
}, },
keys = require("data.keys").nekifoch, keys = data.keys.nekifoch,
cond = require("data.func").is_kitty(), cond = data.func.is_kitty(),
}, },
{ -- WezTerm { -- WezTerm
"willothy/wezterm.nvim", "willothy/wezterm.nvim",
config = true, config = true,
cond = function() -- Using WezTerm cond = data.func.is_wezterm(),
local wterm = os.getenv("TERM_PROGRAM")
return wterm and string.find(wterm, "WezTerm")
end,
}, },
{ -- Tmux { -- Tmux
"aserowy/tmux.nvim", "aserowy/tmux.nvim",
config = function() config = function()
return require("tmux").setup() return require("tmux").setup()
end, end,
cond = require("data.func").is_tmux(), cond = data.func.is_tmux(),
}, },
} }