Skip to content

Commit

Permalink
refactor(core): store modules and maps inside root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnwriter committed Aug 14, 2024
1 parent 7e954b7 commit 5726d86
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

vim.loader.enable()

require("core.opts").initial()
require("opts").initial()

local lazy_path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
local lazy_url = "https://github.com/folke/lazy.nvim"
Expand Down
8 changes: 4 additions & 4 deletions lua/core/mappings.lua → lua/mappings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local utils = require "core.utils"
local modules = require "modules"

local function map(mode, keys, action, desc)
desc = desc or ""
Expand Down Expand Up @@ -97,11 +97,11 @@ end

M.misc = function()
map("n", "<leader>n", function()
utils.toggle_numbering()
modules.toggle_numbering()
end, "Toggle line numbering")

map("n", "<leader>tf", function()
utils.toggle_flow()
modules.toggle_flow()
end, "Toggle flow")
end

Expand All @@ -123,7 +123,7 @@ M.lsp = function()
map("n", "<leader>sd", vim.diagnostic.setloclist)

map("n", "<leader>hi", function()
utils.toggle_inlay_hint() -- toggle inlay hint
modules.toggle_inlay_hint() -- toggle inlay hint
end, "Toggle inlay hint")

map("n", "<leader>k", vim.lsp.buf.hover, "Open lsp hover")
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ local plugins = {
"git",
"diff",
}
require("core.mappings").mini()
require("mappings").mini()
for _, module in ipairs(mini_modules) do
require("mini." .. module).setup(mini_config[module])
end
Expand Down Expand Up @@ -138,7 +138,7 @@ local plugins = {
event = { "BufReadPost", "BufNewFile" },
config = function()
require "plugins.lsp"
require("core.mappings").lsp()
require("mappings").lsp()
end,
},

Expand All @@ -157,10 +157,10 @@ local plugins = {
event = "VeryLazy",
dir = conf_path,
config = function()
require("core.opts").final()
require("core.mappings").general()
require("core.mappings").misc()
require("core.utils").autocmds()
require("opts").final()
require("mappings").general()
require("mappings").misc()
require("modules").autocmds()
end,
},
}
Expand Down

0 comments on commit 5726d86

Please sign in to comment.