1
0
Fork 0
This commit is contained in:
zymon 2025-03-16 20:21:16 +01:00
parent ce4c38469e
commit aa4eadeb61
4 changed files with 85 additions and 65 deletions

View file

@ -2,21 +2,6 @@ vim.keymap.set("i", "jk", "<ESC>")
vim.keymap.set("n", "<leader>pl", "<cmd>Lazy<cr>", { desc = "Lazy" })
vim.keymap.set("n", "<leader>uc", function ()
if #vim.o.colorcolumn == 0 then
vim.o.colorcolumn = "80"
else
vim.o.colorcolumn = ""
end
end, { desc = "toggle 80th column" })
vim.keymap.set("n", "<leader>ur", function ()
if vim.o.relativenumber then
vim.o.relativenumber = false
else
vim.o.relativenumber = true
end
end, { desc = "toggle relative numbers" })
vim.keymap.set("n", "<C-A-k>", "<cmd>m .-2<cr>==", { desc = "move up" })
vim.keymap.set("n", "<C-A-j>", "<cmd>m .+1<cr>==", { desc = "move line down" })

View file

@ -34,7 +34,7 @@ return {
map("n", "<leader>gB", function() gitsigns.blame_line({ full = true }) end, "full blame!")
map("n", "<leader>gp", gitsigns.preview_hunk, "look at hunk")
map("n", "<leader>gS", ":Gitsigns select_hunk<CR>", "select hunk")
map("n", "<leader>gdd", gitsigns.diffthis, "diff this")
-- map("n", "<leader>gdd", gitsigns.diffthis, "diff this")
map("n", "<leader>gsb", gitsigns.stage_buffer, "stage buffer")
map("n", "<leader>gsh", ":Gitsigns stage_hunk<CR>", "stage hunk (toggle)")
@ -63,6 +63,8 @@ return {
event = "BufReadPre",
keys = {
{ "<leader>gdo", "<CMD>DiffviewOpen<CR>", desc = "open diffview", },
{ "<leader>gdf", "<CMD>DiffviewFileHistory<CR>", desc = "open diffview", },
{ "<leader>gdF", "<CMD>DiffviewFileHistory %<CR>", desc = "open file", },
{ "<leader>gdc", "<CMD>DiffviewClose<CR>", desc = "close diffview", },
}
},

View file

@ -205,6 +205,8 @@ return {
end,
desc = "[P]Snacks picker buffers",
},
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" },
},
opts = {
picker = {
@ -240,12 +242,14 @@ return {
notify = { enabled = true },
quickfile = { enabled = true },
words = { enabled = true },
toggle = { enabled = true },
indent = { enabled = true },
dashboard = {
sections = {
{
section = "terminal",
cmd = "chafa ~/i/piksela_arto/docks_1041uuu_Toyoi_Yuuta.gif --format symbols --symbols vhalf --size 60x17 --stretch; sleep .1",
cmd =
"chafa ~/i/piksela_arto/docks_1041uuu_Toyoi_Yuuta.gif --format symbols --symbols vhalf --size 60x17 --stretch; sleep .1",
height = 17,
padding = 1,
},
@ -256,7 +260,60 @@ return {
},
},
},
zen = { enabled = true },
},
init = function()
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
Snacks = require("snacks")
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.line_number():map("<leader>ul")
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
Snacks.toggle.option("conceallevel",
{ off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map("<leader>uc")
Snacks.toggle.treesitter():map("<leader>uT")
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map(
"<leader>ub")
Snacks.toggle.inlay_hints():map("<leader>uh")
Snacks.toggle.indent():map("<leader>ug")
Snacks.toggle.dim():map("<leader>uD")
local toggleopt = {
name = "80th column",
keys = "<leader>uc",
which_key = true,
get = function()
return vim.o.colorcolumn == "80"
end,
notify = false,
set = function(state)
if state then
vim.o.colorcolumn = "80"
else
vim.o.colorcolumn = ""
end
end,
}
require("snacks.toggle").new(toggleopt):map(toggleopt.keys, { mode = { "n" } })
require("snacks").toggle({
name = "Diffview",
get = function()
return require("diffview.lib").get_current_view() ~= nil
end,
set = function(state)
vim.cmd("Diffview" .. (state and "Open" or "Close"))
end,
}):map("<leader>gdd")
end,
})
end
},
{

View file

@ -1,28 +1,4 @@
return {
{ -- notification popups
"https://github.com/rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "clear notifications",
},
},
opts = {
stages = "fade_in_slide_out",
render = "compact",
background_colour = "#000000",
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
},
},
{ -- a snazzy bufferline
"https://github.com/akinsho/bufferline.nvim",
event = "BufReadPre",