added a load of nonsense and fixed the flake
This commit is contained in:
25
flake.nix
25
flake.nix
@@ -17,6 +17,7 @@
|
|||||||
vscode-langservers-extracted
|
vscode-langservers-extracted
|
||||||
emmet-ls
|
emmet-ls
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
|
ast-grep
|
||||||
prettier
|
prettier
|
||||||
black
|
black
|
||||||
nixfmt
|
nixfmt
|
||||||
@@ -33,32 +34,10 @@
|
|||||||
tree-sitter
|
tree-sitter
|
||||||
ripgrep
|
ripgrep
|
||||||
gcc
|
gcc
|
||||||
|
fzf
|
||||||
gnumake
|
gnumake
|
||||||
imagemagick
|
imagemagick
|
||||||
luajitPackages.magick
|
|
||||||
ghostscript
|
|
||||||
luarocks
|
luarocks
|
||||||
|
|
||||||
(texlive.combine {
|
|
||||||
inherit (texlive)
|
|
||||||
scheme-basic
|
|
||||||
varwidth
|
|
||||||
preview
|
|
||||||
mathtools
|
|
||||||
amsfonts
|
|
||||||
amscdx
|
|
||||||
xcolor
|
|
||||||
dvisvgm
|
|
||||||
dvipng
|
|
||||||
wrapfig
|
|
||||||
standalone
|
|
||||||
graphicxbox
|
|
||||||
amsmath
|
|
||||||
ulem
|
|
||||||
hyperref
|
|
||||||
capt-of
|
|
||||||
;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nvim-wrapped = pkgs.symlinkJoin {
|
nvim-wrapped = pkgs.symlinkJoin {
|
||||||
|
|||||||
@@ -26,9 +26,18 @@ end
|
|||||||
|
|
||||||
Keymap("i", "<C-BS>", "<C-W>") -- C-Backscpace for whole words
|
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
|
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)
|
||||||
|
|||||||
@@ -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({
|
require("conform").setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
@@ -12,3 +15,34 @@ require("conform").setup({
|
|||||||
format_on_save = true,
|
format_on_save = true,
|
||||||
undojoin = 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,
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" },
|
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" },
|
||||||
{ src = "https://github.com/saghen/blink.cmp", name = "blink" },
|
{ src = "https://github.com/saghen/blink.cmp", name = "blink" },
|
||||||
|
{ src = "https://github.com/folke/lazydev.nvim", name = "lazydev" },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config("lua_ls", {
|
vim.lsp.config("lua_ls", {
|
||||||
@@ -41,10 +42,6 @@ vim.lsp.enable({
|
|||||||
vim.o.pumborder = "rounded"
|
vim.o.pumborder = "rounded"
|
||||||
|
|
||||||
require("blink.cmp").setup({
|
require("blink.cmp").setup({
|
||||||
-- Snippet configuration
|
|
||||||
-- snippets = {
|
|
||||||
-- preset = "luasnip", -- Tells blink.cmp to use LuaSnip
|
|
||||||
-- },
|
|
||||||
|
|
||||||
fuzzy = { implementation = "lua" },
|
fuzzy = { implementation = "lua" },
|
||||||
|
|
||||||
@@ -67,11 +64,11 @@ require("blink.cmp").setup({
|
|||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = {
|
default = {
|
||||||
|
-- "lazydev",
|
||||||
"lsp", -- (Equivalent to cmp-nvim-lsp)
|
"lsp", -- (Equivalent to cmp-nvim-lsp)
|
||||||
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
|
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
|
||||||
"buffer", -- (Equivalent to cmp-buffer)
|
"buffer", -- (Equivalent to cmp-buffer)
|
||||||
"path", -- (Equivalent to cmp-path)
|
"path", -- (Equivalent to cmp-path)
|
||||||
-- "cmdline", -- Generally configured separately, but often included by default
|
|
||||||
},
|
},
|
||||||
providers = {
|
providers = {
|
||||||
-- lazydev = {
|
-- lazydev = {
|
||||||
@@ -83,3 +80,10 @@ require("blink.cmp").setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "lua",
|
||||||
|
callback = function()
|
||||||
|
require("lazydev").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
@@ -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({
|
require("catppuccin").setup({
|
||||||
transparent_background = true, -- disables setting the background color.
|
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
|
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require("vimade").setup({
|
||||||
|
recipe = { "minimalist", { animate = true } },
|
||||||
|
fadelevel = 0.6,
|
||||||
|
})
|
||||||
|
|||||||
54
lua/plugins/utils/convenience.lua
Normal file
54
lua/plugins/utils/convenience.lua
Normal 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()
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"plugins": {
|
"plugins": {
|
||||||
|
"autosave": {
|
||||||
|
"rev": "9aabcb8396224dcbf8d51c0c1d620d88a46e89d7",
|
||||||
|
"src": "https://github.com/okuuva/auto-save.nvim"
|
||||||
|
},
|
||||||
"blink": {
|
"blink": {
|
||||||
"rev": "456d38d1cd3743926f329204c2340f3e7840aad6",
|
"rev": "456d38d1cd3743926f329204c2340f3e7840aad6",
|
||||||
"src": "https://github.com/saghen/blink.cmp"
|
"src": "https://github.com/saghen/blink.cmp"
|
||||||
@@ -16,6 +20,18 @@
|
|||||||
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
|
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
},
|
},
|
||||||
|
"flash": {
|
||||||
|
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
|
||||||
|
"src": "https://github.com/folke/flash.nvim"
|
||||||
|
},
|
||||||
|
"lazydev": {
|
||||||
|
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||||
|
"src": "https://github.com/folke/lazydev.nvim"
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"rev": "eab58b48eb11d7745c11c505e0f3057165902461",
|
||||||
|
"src": "https://github.com/mfussenegger/nvim-lint"
|
||||||
|
},
|
||||||
"lspconfig": {
|
"lspconfig": {
|
||||||
"rev": "c588db330592fa477a70d2fee6ba20a57194bdc3",
|
"rev": "c588db330592fa477a70d2fee6ba20a57194bdc3",
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||||
@@ -56,9 +72,21 @@
|
|||||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||||
},
|
},
|
||||||
|
"remember": {
|
||||||
|
"rev": "85aff6dc0a5adab088ef6b9210585ded31c32c7b",
|
||||||
|
"src": "https://github.com/vladdoster/remember.nvim"
|
||||||
|
},
|
||||||
|
"scrolleof": {
|
||||||
|
"rev": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7",
|
||||||
|
"src": "https://github.com/Aasim-A/scrollEOF.nvim"
|
||||||
|
},
|
||||||
"treesitter": {
|
"treesitter": {
|
||||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
|
},
|
||||||
|
"vimade": {
|
||||||
|
"rev": "9b2eacd9c97c0bb547f6f3a27e8b5b7a70ad4d03",
|
||||||
|
"src": "https://github.com/tadaa/vimade"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user