49 lines
3.2 KiB
Markdown
49 lines
3.2 KiB
Markdown
---
|
||
title: CPerl mode用のsnippet.elの設定(仮)
|
||
author: kazu634
|
||
date: 2008-01-18
|
||
wordtwit_post_info:
|
||
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:3627;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
|
||
categories:
|
||
- Emacs
|
||
- Perl
|
||
|
||
---
|
||
<div class="section">
|
||
<p>
|
||
とりあえずifとforeachだけ付け加えてみた。
|
||
</p>
|
||
|
||
<pre class="syntax-highlight">
|
||
<span class="synComment">;; === snippet ===</span>
|
||
<span class="synComment">;; snippet.el で、addrev に定型文を追加する</span>
|
||
<span class="synComment">;; 設定方法の例</span>
|
||
<span class="synComment">;; (add-hook 'sgml-mode-hook</span>
|
||
<span class="synComment">;; '(lambda ()</span>
|
||
<span class="synComment">;; (setq-default abbrev-mode t) ;; abbrev-mode をon</span>
|
||
<span class="synComment">;; (snippet-with-abbrev-table '任意のmode-abbrev-table </span>
|
||
<span class="synComment">;; ("略称の文字列1" . "展開する文字列1")</span>
|
||
<span class="synComment">;; ))</span>
|
||
<span class="synComment">;; )</span>
|
||
<span class="synComment">;; 参考:</span>
|
||
<span class="synComment">;; emacs + snippet.el の定型文補完(スニペット)で楽々HTML編集:Goodpic</span>
|
||
<span class="synComment">;; http://www.goodpic.com/mt/archives2/2007/02/emacs_snippetel_html.html</span>
|
||
<span class="synComment">;; unknownplace.org - Tags: emacs</span>
|
||
<span class="synComment">;; http://unknownplace.org/memo/tag/emacs</span>
|
||
<span class="synComment">;; 展開文字列の設定</span>
|
||
<span class="synComment">;; $${} ;; タブキーで移動可能な入力エリア</span>
|
||
<span class="synComment">;; $. ;; タブ入力を終了した後の、カーソルの位置</span>
|
||
<span class="synComment">;; $> ;; その行をインデントする</span>
|
||
<span class="synSpecial">(</span><span class="synStatement">require</span> <span class="synSpecial">'</span><span class="synIdentifier">snippet</span><span class="synSpecial">)</span>
|
||
<span class="synComment">;; cperl mode</span>
|
||
<span class="synSpecial">(</span>add-hook <span class="synSpecial">'</span><span class="synIdentifier">cperl-mode-hook</span>
|
||
<span class="synSpecial">'(</span><span class="synStatement">lambda</span> <span class="synSpecial">()</span>
|
||
<span class="synSpecial">(</span>setq-default abbrev-mode <span class="synStatement">t</span><span class="synSpecial">)</span> <span class="synComment">;; abbrev-mode をon</span>
|
||
<span class="synSpecial">(</span>snippet-with-abbrev-table 'cperl-mode-abbrev-table
|
||
<span class="synSpecial">(</span><span class="synConstant">"if"</span> . <span class="synConstant">"if ($${arg}) {\n$>$.\n}"</span><span class="synSpecial">)</span>
|
||
<span class="synSpecial">(</span><span class="synConstant">"foreach"</span> . <span class="synConstant">"foreach ($${arg}) {\n$>$.\n}"</span><span class="synSpecial">)</span>
|
||
<span class="synSpecial">))</span>
|
||
<span class="synSpecial">)</span>
|
||
</pre>
|
||
</div>
|