From 2a6ef4affeaef6aaccf8873bc9d1912bb88a9bfa Mon Sep 17 00:00:00 2001 From: Chris Pecunies Date: Mon, 23 Dec 2024 04:20:43 -0800 Subject: [PATCH] adding dev mode --- README.md | 36 ++++++++++++++--------------------- ext/lsp | 2 +- lua/down.lua | 6 ++++-- lua/down/mod.lua | 6 +++--- lua/down/mod/config/README.md | 0 lua/down/mod/config/init.lua | 11 +++++++++++ readme.dn | 1 - 7 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 lua/down/mod/config/README.md create mode 100644 lua/down/mod/config/init.lua delete mode 100644 readme.dn diff --git a/README.md b/README.md index ef73fd7..37fe9d7 100644 --- a/README.md +++ b/README.md @@ -52,21 +52,17 @@ the _familiar_, organized future for neovim and beyond! -- Place in lazy.nvim spec { "clpi/down.lua", - version = "*", lazy = false, - branch = "master", - config = function() - require "down".setup { - workspace = { - default = "notes", - workspaces = { - default = "~/down", - notes = "~/notes", - personal = "~/home" - } + opts = { + workspace = { + default = "notes", + workspaces = { + default = "~/down", + notes = "~/notes", + personal = "~/home" } } - end, + }, dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-lua/plenary.nvim", @@ -238,16 +234,12 @@ use { -- with workspace 'home' at ~/home -- and make it default require("down").setup({ ---@type down.mod.Config - mod = { - workspace = { - config = { - default = 'home', - workspaces = { - default = "~/down", - home = "~/notes", - notes = "~/notes" - } - } + workspace = { + default = 'home', + workspaces = { + default = "~/down", + home = "~/notes", + notes = "~/notes" } } }) diff --git a/ext/lsp b/ext/lsp index c42052d..65fef18 160000 --- a/ext/lsp +++ b/ext/lsp @@ -1 +1 @@ -Subproject commit c42052db35846f68372ad55f7ea58de2086b11a3 +Subproject commit 65fef18c5987c196d9b670ea7ca3d509aee1a5bf diff --git a/lua/down.lua b/lua/down.lua index 167afcb..2c90ee7 100644 --- a/lua/down.lua +++ b/lua/down.lua @@ -57,8 +57,10 @@ function W.setup(conf) end, }) end - -- require 'down.util.lsp'.setup() - -- require 'down.util.lsp'.run() + if conf.config and conf.config.dev then + require 'down.util.lsp'.setup() + require 'down.util.lsp'.run() + end end ---@param manual table diff --git a/lua/down/mod.lua b/lua/down/mod.lua index c44f1fb..1a0a5f3 100644 --- a/lua/down/mod.lua +++ b/lua/down/mod.lua @@ -110,7 +110,7 @@ end --- @param name string The name of the new metainit. Modake sure this is unique. The recommended naming convention is `categoryn` or `category.subcategoryn`. --- @param ... string A list of init names to load. --- @return down -local modules = function(name, ...) +Mod.modules = function(name, ...) ---@type down local m = Mod.create(name) m.config.enable = { ... } @@ -408,7 +408,7 @@ end --- @param cfg? table A config that reflects the structure of down.config.user.setup["init.name"].config function Mod.load_mod_as_dependency(modn, parent_mod, cfg) if Mod.load_mod(modn, cfg) and Mod.is_mod_loaded(parent_mod) then - Mod.loaded_mod[parent_mod].required[modn] = Mod_config(modn) + Mod.loaded_mod[parent_mod].required[modn] = Mod.mod_config(modn) end end @@ -428,7 +428,7 @@ end --- Returns the init.config table if the init is loaded --- @param modn string The name of the init to retrieve (init must be loaded) --- @return table? -function Mod_config(modn) +function Mod.mod_config(modn) if not Mod.is_mod_loaded(modn) then log.trace('Attempt to get init config with name' .. modn .. 'failed - init is not loaded.') return diff --git a/lua/down/mod/config/README.md b/lua/down/mod/config/README.md new file mode 100644 index 0000000..e69de29 diff --git a/lua/down/mod/config/init.lua b/lua/down/mod/config/init.lua new file mode 100644 index 0000000..1cecf59 --- /dev/null +++ b/lua/down/mod/config/init.lua @@ -0,0 +1,11 @@ +---@class down.config.Config +D = require 'down.mod'.modules( + 'config', + 'data', + 'cmd', + 'edit', + 'workspace', + 'ui' +) + +D.dev = false diff --git a/readme.dn b/readme.dn deleted file mode 100644 index 7b5ee7e..0000000 --- a/readme.dn +++ /dev/null @@ -1 +0,0 @@ -fn main() {}