summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/custom-neovim/config/init.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/colorscheme.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/neovide.lua9
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/snacks.lua56
-rw-r--r--pkgs/custom-neovim/default.nix3
5 files changed, 70 insertions, 6 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua
index 70a8d54..503f174 100644
--- a/pkgs/custom-neovim/config/init.lua
+++ b/pkgs/custom-neovim/config/init.lua
@@ -13,9 +13,9 @@ require("neovide")
-- UI Plugins:
require("plugins.lualine")
require("plugins.tabby")
-require("plugins.telescope")
+-- require("plugins.telescope")
require("plugins.which-key")
-require("plugins.snacks.dashboard")
+require("plugins.snacks")
-- LSP Plugins:
require("plugins.lspconfig")
diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua
index 82e1420..ed03aef 100644
--- a/pkgs/custom-neovim/config/lua/colorscheme.lua
+++ b/pkgs/custom-neovim/config/lua/colorscheme.lua
@@ -15,6 +15,7 @@ vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, {
if correct_borderless_windows then
link_highlight("FloatBorder", "Comment")
+ -- Telescope-specific highlights
link_highlight("TelescopeBorder", "Comment")
link_highlight("TelescopeResultsTitle", "Variable")
link_highlight("TelescopePreviewTitle", "Variable")
@@ -22,6 +23,9 @@ vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, {
link_highlight("TelescopePromptNormal", "Variable")
link_highlight("TelescopePromptBorder", "Variable")
link_highlight("TelescopePromptPrefix", "Variable")
+
+ -- Snacks-specific highlights
+ link_highlight("SnacksPickerDir", "SnacksPickerFile")
end
end,
})
diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua
index 0476765..dc804fc 100644
--- a/pkgs/custom-neovim/config/lua/neovide.lua
+++ b/pkgs/custom-neovim/config/lua/neovide.lua
@@ -1,16 +1,17 @@
if vim.g.neovide then
+-- if false then
vim.o.guifont = "CodeNewRoman Nerd Font:h12"
- vim.g.neovide_scale_factor = 0.8
+ -- vim.g.neovide_scale_factor = 0.8
-- Zoom keymaps.
local change_scale_factor = function(delta)
- vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
+ vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + delta
end
vim.keymap.set("n", "<C-=>", function()
- change_scale_factor(1.1)
+ change_scale_factor(1)
end)
vim.keymap.set("n", "<C-->", function()
- change_scale_factor(1/1.1)
+ change_scale_factor(-1)
end)
-- Standard terminal emulator keymaps.
diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks.lua b/pkgs/custom-neovim/config/lua/plugins/snacks.lua
index 57c3bc9..324b013 100644
--- a/pkgs/custom-neovim/config/lua/plugins/snacks.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/snacks.lua
@@ -1,4 +1,60 @@
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 },
+ },
+ }
}
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 8abc968..7c63e5f 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -55,6 +55,7 @@ in
# Miscellaneous Plugins
presence-nvim # Discord RPC for nvim.
cellular-automaton-nvim # Fun useless plugin.
+ vim-wakatime # For hack club challenge.
];
opt = [];
};
@@ -73,5 +74,7 @@ in
# Extra Tools
ripgrep
fd
+
+ wakatime-cli
];
}