By Rémino Rem https://remino.net/
Plugin to browse scraps (snippets) directory in Neovim.
https://github.com/remino/scraps.nvim/
Like many developers out there, I have a directory where I keep several snippets. There are many snippet plugins out there, but they all require snippets to be in a specific format. I just wanted to keep some plain code files in a directory, which I call "scraps", have an easy way to browse them, and either open files or immediately paste the file's content into the current buffer. For this reason, I created this plugin.
This plugin requires Telescope.
Using lazy.nvim:
{
"remino/scraps.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
cmd = { "Scraps", "ScrapsConfigDir", "ScrapsCurrentDir" },
opts = {
scraps_dir = "~/scraps", -- Optional. Defaults to ~/.local/share/scraps.
},
keys = {
{ "<leader>fs", ":Scraps<CR>", desc = "Browse scraps" },
},
}
This adds three commands:
:Scraps
to browse the scraps directory.:ScrapsConfigDir
to browse the configuration directory.:ScrapsCurrentDir
to browse the current directory.
These use the Telescope find_files
browser. You can open a file by pressing
<CR>
, or paste its content into the current buffer by pressing <C-p>
.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Distributed under the ISC License. See LICENSE.txt
for more information.
Rémino Rem https://remino.net/