mirror of
https://github.com/zoriya/flake.git
synced 2026-05-30 01:38:11 +00:00
Add surround, sleuth & auto-save
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"nvim-surround",
|
||||
lazy = false,
|
||||
load = function() end,
|
||||
after = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user