code-snippet

code-snippet is a simple input assistance of code snippets for Vim.
Download

code-snippet Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Taku Miyakawa
  • Publisher web site:
  • http://ripjohn.net/program/vim/index.html

code-snippet Tags


code-snippet Description

code-snippet is a simple input assistance of code snippets for Vim. code-snippet is a simple input assistance of code snippets for Vim.This plugin provides a simple input assistance of code snippets. A code snippet is an idiom much used in source codes or marked-up texts. Here are the basic steps to use (and they are almost all): 1. Register snippets (generally in filetype plugins). 2. Type a trigger string in the insert mode. 3. Press < S-CR > or < C-CR > to expand a snippet, and jump to each next/previous placeholder. 4. Press < CR > to fill in a placeholder.Snippets are registered as abbreviations. You can therefore expand them by pressing < Esc > like mere abbreviations.Placeholders can contain default strings. This plugin is well configurable. You can configure these points:· Map commands to other keys.· Use the select mode instead of the visual mode.· Change the format of placeholders in general or buffer-local.Example:Type like this in the commandline mode. :StringAbbrLocal fputs() "fputs(, )"Then type like this in the insert mode. fputs()And press < S-CR >. fputs(, )The line is expanded like above and "" is selected in the visual mode. "" is a placeholder. Each time you press < S-CR >, the cursor jumps to the next placeholder. Press < C-CR > to jump back to the previous placeholder.When you press < CR >, the placeholder under the cursor is cut and Vim switches to the insert mode. So that you can fill in the place. Pressing < CR > at the second placeholder "", the default string "stderr" is inserted. If you want to insert another word, it can be deleted by pressing < C-U > (see :help i_Ctrl-U). Requirements:· VimINSTALLATION:Extract the zip file to "$HOME/.vim/" (*nix). Then open "code-snippet.txt" with Vim under "$HOME/.vim/doc/", and type ":helptags ." as an ex command to register help files.To enable loading plugins and indent files for particular file types, it is recomended to add this line to your .vimrc file. filetype plugin indent onIt is not required for running this plugin, but necessary for registering snippets for particular file types. And the setting makes it easy to register multi-line snippets. See ":help filetype".On most terminal emulators, and some other systems, < S-CR > and < C-CR > of the default key mappings may not work. In those conditions, You should therefore map the commands to other keys. See ":help code-snippet-mappings".It is same as installing other plugins. See ":help add-plugin" and ":help add-local-help" for more information.


code-snippet Related Software