VimScriptでHashTableを実装する

2009-01-11

ruby_imaps.vim を入れた。補完、snippetなど

| 07:56


間違いある可能性。


  • insert modeにてC-X,O で自動補完が入る
  • snippetは、maplocalladerを;として使う。よく使いそうなのをruby_imaps.vim内からぴっくあっぷ

; + command
bl { \|<+ arg +>\| <+ block +> }
bldo do \|<+ arg +>\|\n <+ block +>\nend
cas case\nwhen <+ condition +>\n<+ action +>\nelse\n<+ action +>\nend
cast case <+ target +>\nwhen <+ comparison +>\n<+ action +>\nelse\n<+ action +>\nend
con concat( <+ other_array +> )
def def <+ defname +>\nend
defi def initialize\n<++>\nend
defs def self.<+ class method name +>\nend
do do \|<++>\|っ\n<++>\nend
if if <+ boolean exp +>\n<+ block +>\nend
tif <+ boolean exp +> ? <+ exp if true +> : <+ exp if false +>
elsif elsif <+ boolean exp +>\n<+ block +>
unl unless <+ boolean exp +>\n<+ block +>\nend
sqs %q/<+ single quoted string +>/
dqs %Q/<+ double quoted string +>/
int #{<+ string to substitute +>}
%w %w/<+ words in array (not substituted) +>/
%W %W/<+ words in array (substituted) +>/
cl class <+ class name +>\nend
ea each {\|<+ record +>\| <+ block +> }
eai each_index {\|<+ index +>\| <+ block +> }
eak each_key {\|<+ key +>\| <+ block +> }
eal each_line {\|<+ line +>\| <+ block +> }
eav each_value {\|<+ value +>\| <+ block +> }
dirg Dir.glob(\"<+ pattern +>\") { \|file\| <+ block +> }
file File.foreach(\"<+ dirname +>\") { \|file\| <+ block +> }
open open(\"<+ path or url +>\", \"<+ rw +>\") { \|io\| <+ block +> }
col collect { \|<+ obj +>\| <+ block +> }
fin find { \|<+ element +>\| <+ block +> }
grep grep(/<+ pattern +>/) { \|<+ match +>\| <+ block +> }
rej reject {\|<+ element +>\| <+ block +> }
sel select {\|<+ element +>\| <+ block +> }
sub sub(/<+ pattern +>/) {\|<+ match +>\| <+ block +> }
gsub gsub(/<+ pattern +>/) {\|<+ match +>\| <+ block +> }
h <Space>=><Space>
com <Space><=><Space>


ruby_imaps.vim内でIMAP_PutTextWithMovementという関数が使われている。これは


*IMAP_PutTextWithMovement* *ls_a_ea*

You can also set up a Latex-Suite style mapping which calls a custom

function as follows:

:call IMAP('FOO', "\<C-r>=MyFoonction()\<CR>", 'tex')

where MyFoonction is a custom function you have written. If

MyFoonction also has to return a string containing <++> characters,

then you will need to use the function IMAP_PutTextWithMovement(). An

example best explains the usage:

ujihisaujihisa 2010/02/24 06:54 途中に出てくる「つ」が気になります

SundanceSundance 2011/07/09 20:09 Why do I bother cllaing up people when I can just read this!

dorgbpypiudorgbpypiu 2011/07/10 00:47 YJWbQe <a href="http://ushpkiwawlxf.com/">ushpkiwawlxf</a>

seuiutussqseuiutussq 2011/07/10 20:30 fX4dQo , [url=http://kvqvzqekyxzk.com/]kvqvzqekyxzk[/url], [link=http://sqwefnfzvpdo.com/]sqwefnfzvpdo[/link], http://gmvbqreigiec.com/

wjmgcrbzhwjmgcrbzh 2011/07/11 20:06 HP4kVn <a href="http://ogagshodiliy.com/">ogagshodiliy</a>

bjhpyrebjhpyre 2011/07/12 22:02 KAxQQX , [url=http://lkzlufsmeack.com/]lkzlufsmeack[/url], [link=http://ukdnumeandyf.com/]ukdnumeandyf[/link], http://nudatqmkjtsn.com/

ゲスト



トラックバック - http://vim.g.hatena.ne.jp/Hash/20090111