feat(nvim): Replace alpha with snacks.dashboard

This commit is contained in:
demenik
2025-12-16 19:48:55 +01:00
parent 23815e533e
commit d97c513f1c
8 changed files with 153 additions and 152 deletions

View File

@@ -4,7 +4,7 @@ require("incline").setup {}
vim.cmd [[ vim.cmd [[
hi CurrentWord guifg=#cba6f7 hi CurrentWord guifg=#cba6f7
let g:vim_current_word#hightlight_twins = 0 let g:vim_current_word#hightlight_twins = 0
let g:vim_current_word#excluded_filetypes = ["minifiles", "netrw", "alpha"] let g:vim_current_word#excluded_filetypes = ["minifiles", "netrw", "snacks_dashboard"]
]] ]]
local g = vim.g local g = vim.g

View File

@@ -18,11 +18,11 @@
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
desc = "Disable indentscope for certain filetypes", desc = "Disable indentscope for certain filetypes",
pattern = { pattern = {
"alpha",
"help", "help",
"NvimTree", "NvimTree",
"toggleterm", "toggleterm",
"Trouble", "Trouble",
"snacks_dashboard",
}, },
callback = function() callback = function()
vim.b.miniindentscope_disable = true vim.b.miniindentscope_disable = true

View File

@@ -1,61 +0,0 @@
let
themes = import ./themes.nix;
theme = themes.dg_baby;
in {
plugins.alpha = {
enable = true;
settings = {
layout = [
{
type = "padding";
val = 2;
}
{
type = "text";
val = theme.image;
opts = {
position = "center";
hl = "Type";
};
}
{
type = "padding";
val = 2;
}
{
type = "group";
val = let
button = shortcut: val: {
type = "button";
inherit val;
opts = {
position = "center";
inherit shortcut;
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
};
in [
(button "󱁐 ff" "󰱼 Find file")
(button "󱁐 fo" "󱋡 Recently opened files")
(button "󱁐 fl" " Live-Grep")
];
}
{
type = "padding";
val = 2;
}
{
type = "text";
val = theme.quote;
opts = {
position = "center";
hl = "Keyword";
};
}
];
};
};
}

View File

@@ -1,53 +0,0 @@
{
rei = {
quote = "";
image = [
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
];
};
dg_baby = {
quote = "Official Drain © Licensed Product";
image = [
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
];
};
}

View File

@@ -1,6 +1,5 @@
{ {
imports = [ imports = [
./alpha
./lualine ./lualine
./toggleterm.nix ./toggleterm.nix
./which-key ./which-key
@@ -10,7 +9,7 @@
./silicon.nix ./silicon.nix
./todo-comments.nix ./todo-comments.nix
./debugging.nix ./debugging.nix
./snacks.nix ./snacks
]; ];
plugins = { plugins = {

View File

@@ -1,34 +0,0 @@
{
plugins.snacks = {
enable = true;
settings = {
bigfile.enabled = true;
notifier = {
enabled = true;
timeout = 3000;
};
bufdelete.enabled = true;
image.enabled = true;
quickfile.enabled = true;
rename.enabled = true;
};
};
extraConfigLua =
# lua
''
local prev = { new_name = "", old_name = "" } -- Prevents duplicate events
vim.api.nvim_create_autocmd("User", {
pattern = "NvimTreeSetup",
callback = function()
local events = require("nvim-tree.api").events
events.subscribe(events.Event.NodeRenamed, function(data)
if prev.new_name ~= data.new_name or prev.old_name ~= data.old_name then
data = data
Snacks.rename.on_rename_file(data.old_name, data.new_name)
end
end)
end,
})
'';
}

View File

@@ -0,0 +1,97 @@
{
plugins.snacks = {
enable = true;
settings = {
bigfile.enabled = true;
notifier = {
enabled = true;
timeout = 3000;
};
bufdelete.enabled = true;
image.enabled = true;
quickfile.enabled = true;
rename.enabled = true;
dashboard = let
themes = import ./themes.nix;
theme = themes.dg_baby;
in {
enabled = true;
preset = {
inherit (theme) header;
keys = [
{
icon = " ";
key = "f";
desc = "Find File";
action = ":lua Snacks.dashboard.pick('files')";
}
{
icon = " ";
key = "n";
desc = "New File";
action = ":ene | startinsert";
}
{
icon = " ";
key = "l";
desc = "Live Grep";
action = ":lua Snacks.dashboard.pick('live_grep')";
}
{
icon = " ";
key = "o";
desc = "Old Files";
action = ":lua Snacks.dashboard.pick('oldfiles')";
}
{
icon = " ";
key = "q";
desc = "Quit";
action = ":qa";
}
];
};
sections = [
{section = "header";}
{
section = "keys";
gap = 1;
padding = 1;
}
{
title = theme.quote;
align = "center";
}
];
};
};
};
extraConfigLua =
# lua
''
local prev = { new_name = "", old_name = "" } -- Prevents duplicate events
vim.api.nvim_create_autocmd("User", {
pattern = "NvimTreeSetup",
callback = function()
local events = require("nvim-tree.api").events
events.subscribe(events.Event.NodeRenamed, function(data)
if prev.new_name ~= data.new_name or prev.old_name ~= data.old_name then
data = data
Snacks.rename.on_rename_file(data.old_name, data.new_name)
end
end)
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "SnacksDashboardOpened",
callback = function()
if vim.bo.filetype == "snacks_dashboard" then
vim.b.minitrailspace_disable = true
vim.b.miniindentscope_disable = true
end
end,
})
'';
}

View File

@@ -0,0 +1,53 @@
{
rei = {
quote = "";
header = ''
'';
};
dg_baby = {
quote = "Official Drain © Licensed Product";
header = ''
'';
};
}