sponsor Vim development Vim logo Vim Book Ad

snippets.vim : Simple snippet storage and retrieval separated by filetype.

 script karma  Rating 128/42, Downloaded by 4012  Comments, bugs, improvements  Vim wiki

created by
Jeremy Cantrell
 
script type
utility
 
description
Simple utility for managing snippets of text within vim. Users can add, edit, and delete snippets within vim. Command completion is supported in all places that make sense. A menu is also added at "Plugin/Snippets".

COMMANDS
AddSnippet -- adds new snippet that contain a range of lines
EditSnippet -- edits a snippet in a new tab
DeleteSnippet -- deletes a snippet (with confirmation)
InsertSnippet -- inserts a snippet before the current line
AppendSnippet -- inserts a snippet after the current line
ListSnippets -- lists snippets

MAPPINGS (<leader> is set to '\', by default)
<leader>ssa -- AddSnippet with current buffer (normal mode)
<leader>ssa -- AddSnippet with range of lines (visual mode)
<leader>sse -- EditSnippet
<leader>ssd -- DeleteSnippet
<leader>ssp -- AppendSnippet
<leader>ssP -- InsertSnippet
<leader>ssl -- ListSnippets
 
install details
Place script in ~/.vim/plugin and start vim.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
snippets.vim 0.2 2008-02-23 7.0 Jeremy Cantrell Made functions, variables, and mappings "script-friendly". Thanks #vim!
snippets.vim 0.1.5 2008-02-22 7.0 Jeremy Cantrell Split the PutSnippet command into InsertSnippet and AppendSnippet
snippets.vim 0.1.4 2008-02-14 7.0 Jeremy Cantrell The base snippet directory can now be overridden by setting the variable "g:snippets_base_directory" in the vimrc file.
snippets.vim 0.1.3 2008-02-14 7.0 Jeremy Cantrell Confirmation dialog now uses the builtin confirm()
snippets.vim 0.1.2 2008-02-14 7.0 Jeremy Cantrell Fixed a problem where the base snippet directory was not being created on startup.
snippets.vim 0.1.1 2008-02-13 7.0 Jeremy Cantrell Forgot to add a description to the script header.
ip used for rating: 3.139.107.241

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github