diff options
| author | triethyl <triethylammonium@pm.me> | 2025-07-13 17:17:46 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-07-13 17:17:46 -0400 |
| commit | c3a16f18e513ea81278bf229146ee41da3909f82 (patch) | |
| tree | ef8521c429d4afe3178085b2f23c79542ca3ac75 /pkgs/custom-neovim | |
| parent | 121a0fc03742e878410d6c3b2548869c584dc232 (diff) | |
working on custom neovim
Diffstat (limited to 'pkgs/custom-neovim')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/alpha.lua | 66 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/snacks.lua | 56 |
2 files changed, 15 insertions, 107 deletions
diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index f377b0d..32130f8 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -1,60 +1,24 @@ local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") --- -- Set header --- dashboard.section.header.val = Art.misc.hydra +-- Set header +dashboard.section.header.val = Art.misc.hydra --- -- Set menu --- dashboard.section.buttons.val = { --- dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>" ), --- dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>" ), --- dashboard.button( "s", " > Load session", ":Telescope persisted<cr>" ), --- dashboard.button( "l", " > Load last session", ":SessionLoadLast<cr>" ), --- dashboard.button( "q", " > Quit", ":qa<CR>" ), --- } - --- -- Center components. --- dashboard.section.header.opts.position = "center" --- dashboard.section.footer.opts.position = "center" +-- Set menu +dashboard.section.buttons.val = { + dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files<CR>" ), + dashboard.button( "r", " > Find recent file", ":Telescope oldfiles<CR>" ), + dashboard.button( "s", " > Load session", ":Telescope persisted<cr>" ), + dashboard.button( "l", " > Load last session", ":SessionLoadLast<cr>" ), + dashboard.button( "q", " > Quit", ":qa<CR>" ), +} --- -- Send config to alpha --- alpha.setup(dashboard.opts) +-- Center components. +dashboard.section.header.opts.position = "center" +dashboard.section.footer.opts.position = "center" -require("alpha").setup { - dashboard = { - config = {}, - opts = { - autostart = true - }, - section = { - buttons = { - entries = { { "f", " Find File", "<CMD>Telescope find_files<CR>" }, { "n", " New File", "<CMD>ene!<CR>" }, { "p", " Projects ", "<CMD>Telescope projects<CR>" }, { "r", " Recent files", -":Telescope oldfiles <CR>" }, { "t", " Find Text", "<CMD>Telescope live_grep<CR>" }, { "c", " Configuration", "<CMD>edit /home/lucas/.config/lvim/config.lua <CR>" }, { "q", " Quit", "<CMD>quit<CR>" -} }, - opts = { - hl_shortcut = "Include", - spacing = 1 - } - }, - footer = { - opts = { - hl = "Number", - position = "center" - }, - type = "text", - val = { " ", " lunarvim.org", "release-1.4/neovim-0.9-d15c8d7" } - }, - header = { - opts = { - hl = "Label", - position = "center" - }, - type = "text", - } - } - }, - mode = "dashboard", -} +-- Send config to alpha +alpha.setup(dashboard.opts) -- Set options just for the dashboard. vim.api.nvim_create_autocmd("BufEnter", { diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks.lua b/pkgs/custom-neovim/config/lua/plugins/snacks.lua index 324b013..57c3bc9 100644 --- a/pkgs/custom-neovim/config/lua/plugins/snacks.lua +++ b/pkgs/custom-neovim/config/lua/plugins/snacks.lua @@ -1,60 +1,4 @@ require("snacks").setup { bigfile = { enabled = true }, picker = { enabled = true }, - dashboard = { - width = 60, - row = nil, -- dashboard position. nil for center - col = nil, -- dashboard position. nil for center - pane_gap = 4, -- empty columns between vertical panes - autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence - -- These settings are used by some built-in sections - preset = { - -- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick` - ---@type fun(cmd:string, opts:table)|nil - pick = nil, - -- Used by the `keys` section to show keymaps. - -- Set your custom keymaps here. - -- When using a function, the `items` argument are the default keymaps. - ---@type snacks.dashboard.Item[] - keys = { - { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, - { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, - { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, - { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, - { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, - { icon = " ", key = "q", desc = "Quit", action = ":qa" }, - }, - -- Used by the `header` section - header = table.concat(Art.misc.hydra, "\n"), - }, - -- item field formatters - formats = { - icon = function(item) - if item.file and item.icon == "file" or item.icon == "directory" then - return M.icon(item.file, item.icon) - end - return { item.icon, width = 2, hl = "icon" } - end, - footer = { "%s", align = "center" }, - header = { "%s", align = "center" }, - file = function(item, ctx) - local fname = vim.fn.fnamemodify(item.file, ":~") - fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname - if #fname > ctx.width then - local dir = vim.fn.fnamemodify(fname, ":h") - local file = vim.fn.fnamemodify(fname, ":t") - if dir and file then - file = file:sub(-(ctx.width - #dir - 2)) - fname = dir .. "/…" .. file - end - end - local dir, file = fname:match("^(.*)/(.+)$") - return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } } - end, - }, - sections = { - { section = "header" }, - { section = "keys", gap = 1, padding = 1 }, - }, - } } |
