blog/content/post/2008/01/18/2008-01-18-00000754.md

3.2 KiB
Raw Blame History

title author date url wordtwit_post_info categories
CPerl mode用のsnippet.elの設定 kazu634 2008-01-18 /2008/01/18/_807/
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";}}
Emacs
Perl

 とりあえずifとforeachだけ付け加えてみた。

;; === snippet ===
;; snippet.el で、addrev に定型文を追加する
;; 設定方法の例
;; (add-hook 'sgml-mode-hook
;;            '(lambda ()
;; 			  (setq-default abbrev-mode t) ;; abbrev-mode をon
;; 			  (snippet-with-abbrev-table '任意のmode-abbrev-table 
;; 	  ("略称の文字列1" .  "展開する文字列1")
;; 	  ))
;; )
;; 参考:
;; emacs + snippet.el の定型文補完スニペットで楽々HTML編集Goodpic
;; http://www.goodpic.com/mt/archives2/2007/02/emacs_snippetel_html.html
;; unknownplace.org - Tags: emacs
;; http://unknownplace.org/memo/tag/emacs
;; 展開文字列の設定
;; $${}  ;;  タブキーで移動可能な入力エリア
;; $.    ;;  タブ入力を終了した後の、カーソルの位置
;; $> ;;  その行をインデントする
(require 'snippet)
;; cperl mode
(add-hook 'cperl-mode-hook
'(lambda ()
(setq-default abbrev-mode t) ;; abbrev-mode をon
(snippet-with-abbrev-table 'cperl-mode-abbrev-table
("if"  .  "if ($${arg}) {\n$>$.\n}")
("foreach" . "foreach ($${arg}) {\n$>$.\n}")
))
)