added a load of nonsense and fixed the flake

This commit is contained in:
2026-04-10 20:55:51 +01:00
parent 6f7793bde4
commit b76db809f2
8 changed files with 152 additions and 35 deletions

View File

@@ -26,9 +26,18 @@ end
Keymap("i", "<C-BS>", "<C-W>") -- C-Backscpace for whole words
-- Open Lazygit
Keymap("n", "<leader>l", function()
Snacks.lazygit.open()
end)
Keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>") -- Diagnostics for Linter
-- Flash keymaps
Keymap("n", "ss", function()
require("flash").jump()
end)
Keymap("n", "S", function()
require("flash").treesitter()
end)
Keymap("n", "<leader>r", function()
require("flash").remote()
end)
Keymap("n", "<leader>R", function()
require("flash").treesitter_search()
end)

View File

@@ -1,4 +1,7 @@
vim.pack.add({ { src = "https://github.com/stevearc/conform.nvim", name = "conform" } })
vim.pack.add({
{ src = "https://github.com/stevearc/conform.nvim", name = "conform" },
{ src = "https://github.com/mfussenegger/nvim-lint", name = "lint" },
})
require("conform").setup({
formatters_by_ft = {
@@ -12,3 +15,34 @@ require("conform").setup({
format_on_save = true,
undojoin = true,
})
local lint = require("lint")
-- Only show diagnostics close to the cursor
vim.diagnostic.config({
virtual_text = {
spacing = 4,
prefix = function(diagnostic)
local icons = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "󰉀 ",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰌵 ",
}
return icons[diagnostic.severity] or ""
end,
},
signs = false,
underline = true,
update_in_insert = false,
})
-- Auto-run the linter only for the configured filetypes
vim.api.nvim_create_autocmd("BufWritePost", {
callback = function()
local ft = vim.bo.filetype
if lint.linters_by_ft[ft] then
lint.try_lint()
end
end,
})

View File

@@ -1,6 +1,7 @@
vim.pack.add({
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" },
{ src = "https://github.com/saghen/blink.cmp", name = "blink" },
{ src = "https://github.com/folke/lazydev.nvim", name = "lazydev" },
})
vim.lsp.config("lua_ls", {
@@ -41,10 +42,6 @@ vim.lsp.enable({
vim.o.pumborder = "rounded"
require("blink.cmp").setup({
-- Snippet configuration
-- snippets = {
-- preset = "luasnip", -- Tells blink.cmp to use LuaSnip
-- },
fuzzy = { implementation = "lua" },
@@ -67,11 +64,11 @@ require("blink.cmp").setup({
},
sources = {
default = {
-- "lazydev",
"lsp", -- (Equivalent to cmp-nvim-lsp)
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
"buffer", -- (Equivalent to cmp-buffer)
"path", -- (Equivalent to cmp-path)
-- "cmdline", -- Generally configured separately, but often included by default
},
providers = {
-- lazydev = {
@@ -83,3 +80,10 @@ require("blink.cmp").setup({
},
},
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "lua",
callback = function()
require("lazydev").setup()
end,
})

View File

@@ -1,4 +1,7 @@
vim.pack.add({ { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } })
vim.pack.add({
{ src = "https://github.com/catppuccin/nvim", name = "catppuccin" },
{ src = "https://github.com/tadaa/vimade", name = "vimade" },
})
require("catppuccin").setup({
transparent_background = true, -- disables setting the background color.
@@ -8,3 +11,8 @@ require("catppuccin").setup({
},
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
})
require("vimade").setup({
recipe = { "minimalist", { animate = true } },
fadelevel = 0.6,
})

View File

@@ -0,0 +1,54 @@
vim.pack.add({
{ src = "https://github.com/okuuva/auto-save.nvim", name = "autosave" },
{ src = "https://github.com/vladdoster/remember.nvim", name = "remember" },
{ src = "https://github.com/Aasim-A/scrollEOF.nvim", name = "scrolleof" },
{ src = "https://github.com/folke/flash.nvim", name = "flash" },
})
require("auto-save").setup({
enabled = true,
trigger_events = {
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" },
defer_save = { "InsertLeave" }, -- save after debounce
cancel_deferred_save = { "InsertEnter" }, -- cancel pending save
},
debounce_delay = 1000,
noautocmd = true,
})
local group = vim.api.nvim_create_augroup("autosave", {})
-- Notification to say when a file is saved
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveWritePre",
group = group,
callback = function(opts)
if opts.data.saved_buffer ~= nil then
local filename = vim.fn.expand("%:t")
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
end
end,
})
-- Notification when enabling/disabling autosave for a buffer
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveEnable",
group = group,
callback = function(opts)
print("AutoSave enabled")
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveDisable",
group = group,
callback = function(opts)
print("AutoSave disabled")
end,
})
-- enable remember
require("remember").setup({})
-- enable scrolleof
require("scrollEOF").setup()