Closed rafamadriz closed 3 years ago
ok, icon
and file_button
are now exported https://github.com/goolord/alpha-nvim/commit/fb47b78d89e31c15344f66550f13c42a729f4100. you should be able to write your bookmarks like
startify.file_button( "~/.config/nvim/lua/config.lua", "c" ),
and get the icon + highlighting
Also, not related to this issue but how can I change and add titles ? I've looking through the docs and playing around with a few options but can't figure it out.
For example, I'd like to add "Bookmarks" above those files. and I'd like to change the MRU from this image:
this level of granularity in configuration is frankly annoying to support.. after a certain point it becomes easier to just define your own opts
. the startify module should export everything you would need to make your own layout using startify widgets.
this isn't a "hard no", I just don't know where I need to draw the line in the sand with respect to these themes that are meant to mimic the look and feel of other greeter plugins
ok,
icon
andfile_button
are now exported fb47b78. you should be able to write your bookmarks likestartify.file_button( "c", "~/.config/nvim/lua/config.lua" ),
and get the icon + highlighting
The order is inverted, it needs to be:
startify.file_button("~/.config/nvim/lua/config.lua" , "c"),
Otherwise it gives an error.
this level of granularity in configuration is frankly annoying to support.. after a certain point it becomes easier to just define your own opts. the startify module should export everything you would need to make your own layout using startify widgets.
That's a fair point.
my mistake. i'll think on this, there might be a solution that doesn't suck too bad
somehow i missed that with sections you can already pretty easily rearrange the layout with minimal effort.
example moving the header to the bottom:
startify.opts.layout = {
{type = "padding", val = 2},
startify.section.top_buttons,
startify.section.mru,
startify.section.mru_cwd,
{type = "padding", val = 1},
startify.section.bottom_buttons,
{type = "padding", val = 1},
startify.section.header,
startify.section.footer,
}
:)
hi is it possible to still add this to our own configs? like if i have the line local startify = require("alpha.themes.startify")
just use startify.opts.layout = {...}
to reorder the layout?
yes
For those coming here in the future and looking for a complete config example of adding bookmarks to the startify
theme, it could look like this (with Packer) adding 3 bookmarks:
use({
"goolord/alpha-nvim",
requires = { "nvim-tree/nvim-web-devicons" },
config = function()
local startify = require("alpha.themes.startify")
startify.section.bottom_buttons.val = {
startify.button("q", "Quit", "<cmd>q <CR>"), -- preserve the quit button
startify.file_button(vim.fn.stdpath("config") .. "/init.lua", "v"),
startify.file_button(vim.fn.stdpath("config") .. "/lua/plugins.lua", "p"),
startify.file_button("~/some/file", "f"),
}
require("alpha").setup(startify.config)
end,
})
Another way to preserve the q
button could be to append to this table instead of redefining it:
table.insert(startify.section.bottom_buttons.val, startify.file_button(~/some/file", "f"))
Right now I have something like this to have bookmarks to files:
But, as you can see, it doesn't show up with icons.
This is just a nitpick and I'm happy with it not showing icons for those files, but I was wondering if it was possible to make it so I can create bookmarks to files and have it with icons.
Also, not related to this issue but how can I change and add titles ? I've looking through the docs and playing around with a few options but can't figure it out.
For example, I'd like to add "Bookmarks" above those files. and I'd like to change the MRU from this image:
To something else.