mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-09 22:57:37 +00:00
Make default startify bookmarks dynamic
Check for existing directories before adding
This commit is contained in:
parent
ab094dc952
commit
aa3cf08262
@ -209,6 +209,10 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
require("utils").require_with_local("plugins.startify")
|
require("utils").require_with_local("plugins.startify")
|
||||||
end,
|
end,
|
||||||
|
dependencies = {
|
||||||
|
-- Plenary isn't used by startify, but it is used in my config
|
||||||
|
{ "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
|
@ -9,10 +9,26 @@ vim.g.startify_list_order = {
|
|||||||
"sessions",
|
"sessions",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.startify_bookmarks = {
|
local function get_bookmarks()
|
||||||
"~/Documents/Obsidian",
|
local Path = require("plenary.path")
|
||||||
"~/workspace/vim-settings",
|
|
||||||
"~/workspace/shoestrap",
|
local paths = {
|
||||||
"~/.config/fish",
|
"~/Documents/Obsidian",
|
||||||
"~/Nextcloud/Notes",
|
"~/workspace/vim-settings",
|
||||||
}
|
"~/workspace/shoestrap",
|
||||||
|
"~/.config/fish",
|
||||||
|
"~/Nextcloud/Notes",
|
||||||
|
}
|
||||||
|
|
||||||
|
local bookmarks = {}
|
||||||
|
for _, p in ipairs(paths) do
|
||||||
|
local path = Path:new(vim.fn.expand(p))
|
||||||
|
if path:exists() then
|
||||||
|
table.insert(bookmarks, p)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return bookmarks
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.startify_bookmarks = get_bookmarks()
|
||||||
|
Loading…
Reference in New Issue
Block a user