chore: change behaviour of dashboard
This commit is contained in:
1 file changed
+11
-6
+11
-6
@@ -9,11 +9,17 @@ Config.now(function()
|
|||||||
starter.setup({
|
starter.setup({
|
||||||
items = {
|
items = {
|
||||||
function()
|
function()
|
||||||
local dirs = vim.list_extend(vim.fn.glob('~/Code/*', 0, 1), vim.fn.glob('~/Documents/*/*', 0, 1))
|
local dirs = vim.fn.glob('~/Code/*/', false, true)
|
||||||
return vim.iter(dirs):filter(function(p) return vim.fn.isdirectory(p) == 1 end):map(function(p)
|
return vim.tbl_map(function(p)
|
||||||
local open = function() vim.fn.chdir(p) require('mini.files').open(p) end
|
return {
|
||||||
return { name = vim.fn.fnamemodify(p, ':t'), action = open, section = 'Projects' }
|
name = vim.fn.fnamemodify(p, ':h:t'),
|
||||||
end):totable()
|
section = 'Projects',
|
||||||
|
action = function()
|
||||||
|
vim.fn.chdir(p)
|
||||||
|
MiniStarter.close()
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end, dirs)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
starter.sections.builtin_actions(),
|
starter.sections.builtin_actions(),
|
||||||
@@ -70,5 +76,4 @@ Config.now(function()
|
|||||||
MiniFiles.set_bookmark('c', vim.fn.stdpath('config'), { desc = 'Config' })
|
MiniFiles.set_bookmark('c', vim.fn.stdpath('config'), { desc = 'Config' })
|
||||||
MiniFiles.set_bookmark('w', vim.fn.getcwd, { desc = 'Working directory' })
|
MiniFiles.set_bookmark('w', vim.fn.getcwd, { desc = 'Working directory' })
|
||||||
end, 'Add default marks')
|
end, 'Add default marks')
|
||||||
require('mini.misc').setup_auto_root()
|
|
||||||
end)
|
end)
|
||||||
Reference in new issue
Block a user