Skip to content

Commit

Permalink
adding dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Dec 23, 2024
1 parent 28b180c commit 2a6ef4a
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion ext/lsp
Submodule lsp updated 1 files
+0 −0 index.md
6 changes: 4 additions & 2 deletions lua/down.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lua/down/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { ... }
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
Empty file added lua/down/mod/config/README.md
Empty file.
11 changes: 11 additions & 0 deletions lua/down/mod/config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---@class down.config.Config
D = require 'down.mod'.modules(
'config',
'data',
'cmd',
'edit',
'workspace',
'ui'
)

D.dev = false
1 change: 0 additions & 1 deletion readme.dn

This file was deleted.

0 comments on commit 2a6ef4a

Please sign in to comment.