diff --git a/nvim/default.nix b/nvim/default.nix index 9d06475..dfd8c51 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -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 diff --git a/nvim/lua/plugins/auto-save.lua b/nvim/lua/plugins/auto-save.lua new file mode 100644 index 0000000..c411a80 --- /dev/null +++ b/nvim/lua/plugins/auto-save.lua @@ -0,0 +1,31 @@ +return { + { + "auto-save.nvim", + lazy = false, + load = function() end, + keys = { + { + "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, + }, +} diff --git a/nvim/lua/plugins/motions.lua b/nvim/lua/plugins/motions.lua new file mode 100644 index 0000000..341457d --- /dev/null +++ b/nvim/lua/plugins/motions.lua @@ -0,0 +1,10 @@ +return { + { + "nvim-surround", + lazy = false, + load = function() end, + after = function() + require("nvim-surround").setup({}) + end, + } +} diff --git a/nvim/lua/plugins/colors.lua b/nvim/lua/plugins/theme.lua similarity index 100% rename from nvim/lua/plugins/colors.lua rename to nvim/lua/plugins/theme.lua