Skip to content
Browse files

Add an example for Ruby's string interpolation

  • Loading branch information...
1 parent e836551 commit c292e3568b53fb48473fe9a4666718e88785ccae @kana committed Apr 7, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 doc/smartinput.txt
View
14 doc/smartinput.txt
@@ -407,6 +407,20 @@ CUSTOMIZATION *smartinput-customization*
trigger keys for your own rules with |smartinput#map_to_trigger()| or
|smartinput#map_trigger_keys()|.
+ *smartinput-customization-c*
+(C) Example #1: If you often write Ruby script and you want to insert "#{}"
+ by typing "#" in a string literal to input string interpolation easily,
+ add the following lines into your |vimrc|:
+>
+ call smartinput#map_to_trigger('i', '#', '#', '#')
+ call smartinput#define_rule({
+ \ 'at': '\%#',
+ \ 'char': '#',
+ \ 'input': '#{}<Left>',
+ \ 'filetype': ['ruby'],
+ \ 'syntax': ['Constant', 'Special'],
+ \ })
+<

0 comments on commit c292e35

Please sign in to comment.
Something went wrong with that request. Please try again.