mirror of
https://github.com/DefectingCat/nvim
synced 2025-07-15 16:51:33 +00:00
update alpha buttons
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"codesnap.nvim": { "branch": "main", "commit": "c2924bf6c9a2c2c03318fae9b7fe0706412b9d9c" },
|
||||
"conform.nvim": { "branch": "master", "commit": "936f2413e6c57185cd873623a29a0685bce4b423" },
|
||||
"conform.nvim": { "branch": "master", "commit": "46c107ad0e7d83b5a7091112ec2994c847577d32" },
|
||||
"crates.nvim": { "branch": "main", "commit": "b3b9ac6ed9618955b24bf9adede7530ef608495b" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
|
||||
@ -33,18 +33,18 @@
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d88ae6623fef09251e3aa20001bb761686eae730" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "d41b4ca013ed89e41b9c0ecbdae5f1633e42f7fa" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "6a3c6a42a6e24414bdf337b05a84a0ea013dd155" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b6a6d8997c46dc15682020ce4fddc5a89ee1ac0d" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" },
|
||||
"oil.nvim": { "branch": "master", "commit": "1eb9fb35a4613518f79790117ed82c367a0b4a22" },
|
||||
"oil.nvim": { "branch": "master", "commit": "665bf2edc9f9a6d77a6fc636df36276c97fb5d66" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "a5e2d0b1215814c3d033be1fd8eccf59ce366399" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "c37f698bf7c2d942b78d924be9a2aed9f5951e74" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "b546852f7a477276805b01f84ac79c28a962c55b" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "76cd2aeb3080d575617dd88da887cfa9d8c66014" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
|
@ -1,3 +1,39 @@
|
||||
local leader = "SPC"
|
||||
local if_nil = vim.F.if_nil
|
||||
|
||||
--- @param sc string
|
||||
--- @param txt string
|
||||
--- @param keybind string? optional
|
||||
--- @param keybind_opts table? optional
|
||||
local function button(sc, txt, keybind, keybind_opts)
|
||||
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>")
|
||||
|
||||
local opts = {
|
||||
position = "center",
|
||||
shortcut = sc,
|
||||
cursor = 3,
|
||||
width = 30,
|
||||
align_shortcut = "right",
|
||||
hl_shortcut = "Keyword",
|
||||
}
|
||||
if keybind then
|
||||
keybind_opts = if_nil(keybind_opts, { noremap = true, silent = true, nowait = true })
|
||||
opts.keymap = { "n", sc_, keybind, keybind_opts }
|
||||
end
|
||||
|
||||
local function on_press()
|
||||
local key = vim.api.nvim_replace_termcodes(keybind or sc_ .. "<Ignore>", true, false, true)
|
||||
vim.api.nvim_feedkeys(key, "t", false)
|
||||
end
|
||||
|
||||
return {
|
||||
type = "button",
|
||||
val = txt,
|
||||
on_press = on_press,
|
||||
opts = opts,
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
@ -8,11 +44,11 @@ return {
|
||||
local logo = require("rua.config.logos")
|
||||
dashboard.section.header.val = logo.e
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("SPC e", " > Nvim Tree", "<cmd>NvimTreeToggle<CR>"),
|
||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("SPC fw", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("SPC wr", " > Restore Session", "<cmd>SessionRestore<CR>"),
|
||||
dashboard.button("q", " > Quit", "<cmd>qa<CR>"),
|
||||
button("SPC e", " > Nvim Tree", "<cmd>NvimTreeToggle<CR>"),
|
||||
button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
button("SPC fw", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
button("SPC wr", " > Restore Session", "<cmd>SessionRestore<CR>"),
|
||||
button("q", " > Quit", "<cmd>qa<CR>"),
|
||||
}
|
||||
dashboard.opts.layout[1].val = 8
|
||||
|
||||
|
Reference in New Issue
Block a user