A simple Neovim plugin for managing temporary scratch files.
- Create a new scratch file
- Delete or move temp files to trash
- Neovim
- Trash utility (optional):
trash-cli
orgio
Install the plugin using your preferred package manager:
-- lazy.nvim
{
"0x15ba88ff/tnew.nvim",
config = function()
require("tnew").setup()
end,
cmd = { "Tnew", "TnewClean" }
}
-- packer.nvim
use({
"0x15ba88ff/tnew.nvim",
config = function()
require("tnew").setup()
end,
cmd = { "Tnew", "TnewClean" },
})
tnew.nvim
comes with the following defaults:
{
dir = vim.fn.stdpath("cache") .. "/tnew", -- Where to store temp files
filename = "%Y-%m-%d_%H-%M-%S", -- Format for filenames
default_ext = "md", -- Default file extension
delete_to_trash = false -- Move files to trash instead of deleting permanently
}
Configuration is optional β it works out of the box.
Command | Description |
---|---|
:Tnew |
Open a new temp file with the default extension |
:Tnew md |
Open a new temp file with the .md extension |
:TnewClean |
Delete or move all temp files to trash |
Licensed under the Apache License 2.0. See the LICENSE file for details.