Add surround, sleuth & auto-save

This commit is contained in:
2024-12-26 17:44:19 +01:00
parent f37b3a700f
commit 60acf0a289
4 changed files with 45 additions and 0 deletions
+4
View File
@@ -24,11 +24,15 @@ in
plugins = with pkgs.vimPlugins; {
start = [
(mkPlugin lz-nvim "lz-n")
# TODO: use catppuccin's compile feature. see: https://github.com/stasjok/dotfiles/blob/36037f523185ba1409dd953999fda0f0db0dbd4f/nvim/default.nix#L136C8-L148C12
catppuccin-nvim
nvim-treesitter.withAllGrammars
oil-nvim
mini-nvim
nvim-surround
telescope-fzf-native-nvim
vim-sleuth
auto-save-nvim
];
opts = [
telescope-nvim
+31
View File
@@ -0,0 +1,31 @@
return {
{
"auto-save.nvim",
lazy = false,
load = function() end,
keys = {
{
"<leader>w",
function()
vim.g.auto_save_state = not vim.g.auto_save_state
end,
desc = "Toggle autosave"
},
},
event = { "InsertLeave", "TextChanged", },
opts = {
write_all_buffers = true,
condition = function(buf)
if not vim.g.auto_save_state then
return false
end
local ft = vim.fn.getbufvar(buf, "&filetype")
return ft ~= "oil" and ft ~= "harpoon"
end,
},
after = function(plug)
vim.g.auto_save_state = true
require("auto-save").setup(plug.opt)
end,
},
}
+10
View File
@@ -0,0 +1,10 @@
return {
{
"nvim-surround",
lazy = false,
load = function() end,
after = function()
require("nvim-surround").setup({})
end,
}
}