diff --git a/.config/nvim/.neoconf.json b/.config/nvim/.neoconf.json deleted file mode 100644 index 7c4808746..000000000 --- a/.config/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 65046e322..7388724a8 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,8 +1,3 @@ -_G.Config = require("config") -_G.Lib = require("lib") - --- NOTE: lazy.nvim setup - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then @@ -19,17 +14,13 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ spec = { - { - "LazyVim/LazyVim", - import = "lazyvim.plugins", - }, + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "lazyvim.plugins.extras.coding.copilot" }, { import = "lazyvim.plugins.extras.coding.mini-surround" }, { import = "lazyvim.plugins.extras.dap.core" }, { import = "lazyvim.plugins.extras.editor.aerial" }, { import = "lazyvim.plugins.extras.editor.leap" }, { import = "lazyvim.plugins.extras.test.core" }, - -- { import = "lazyvim.plugins.extras.ui.edgy" }, { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, { import = "lazyvim.plugins.extras.lang.ansible" }, { import = "lazyvim.plugins.extras.lang.docker" }, @@ -63,8 +54,6 @@ require("lazy").setup({ }, }) --- NOTE: Autocmds - for _, autocmd in ipairs({ { -- Automatically change line numeration { "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua deleted file mode 100644 index 959bf0061..000000000 --- a/.config/nvim/lua/config/init.lua +++ /dev/null @@ -1,17 +0,0 @@ ----@class config ----@field ui config.ui ----@field language config.language ----@field shortcuts config.shortcuts ----@field secrets? config.secrets -local M = {} - -setmetatable(M, { - __index = function(_, k) - local ok, mod = pcall(require, "config." .. k) - if ok then - return mod - end - end, -}) - -return M diff --git a/.config/nvim/lua/config/shortcuts.lua b/.config/nvim/lua/config/shortcuts.lua index 471ba0d9a..376f35ff0 100644 --- a/.config/nvim/lua/config/shortcuts.lua +++ b/.config/nvim/lua/config/shortcuts.lua @@ -1,5 +1,4 @@ -- NOTE: Managed by shortcuts script ----@class config.shortcuts return { gh = "/home/luca", gch = "/home/luca/.cache", diff --git a/.config/nvim/lua/lib.lua b/.config/nvim/lua/lib.lua index c3224134a..76a6ccfe9 100644 --- a/.config/nvim/lua/lib.lua +++ b/.config/nvim/lua/lib.lua @@ -1,8 +1,7 @@ local M = {} ----@return table function M.generate_shortcut_maps() - local shortcuts = Config.shortcuts + local shortcuts = require("config.shortcuts") local fs = require("neo-tree.sources.filesystem") local maps = {} for map, path in pairs(shortcuts) do @@ -13,8 +12,6 @@ function M.generate_shortcut_maps() return maps end ----@param key string ----@return string? function M.get_secret(key) local ok, keys = pcall(require, "config.secrets") if ok then diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index 5b8a4101a..cd556d181 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -21,6 +21,16 @@ return { }, }, }, + { + "akinsho/bufferline.nvim", + keys = { + { "bs", desc = "Sort Bufferline" }, + { "bsd", "BufferLineSortByDirectory", desc = "By Directory" }, + { "bse", "BufferLineSortByExtension", desc = "By Extension" }, + { "bsr", "BufferLineSortByRelativeDirectory", desc = "By Relative Directory" }, + { "bst", "BufferLineSortByTabs", desc = "By Tabs" }, + }, + }, { "ggandor/flit.nvim", enabled = false, @@ -115,7 +125,7 @@ return { }, }, config = function(_, opts) - local key = Lib.get_secret("openai") + local key = require("lib").get_secret("openai") if key then require("chatgpt.api").OPENAI_API_KEY = key require("chatgpt.api").AUTHORIZATION_HEADER = "Authorization: Bearer " .. key @@ -260,7 +270,7 @@ return { opts = { filesystem = { window = { - mappings = Lib.generate_shortcut_maps(), + mappings = require("lib").generate_shortcut_maps(), }, }, }, diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index 436798007..dff682b76 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -28,8 +28,8 @@ return { { "nvimdev/dashboard-nvim", opts = function(_, opts) - local center = Config.ui.buttons - local banners = Config.ui.banners + local center = require("config.ui").buttons + local banners = require("config.ui").banners for _, button in ipairs(center) do button.desc = button.desc .. string.rep(" ", 43 - #button.desc) button.key_format = " %s"