Created
January 20, 2017 06:11
-
-
Save kiwanami/aeb45b81564cf147bb138a63dabf5633 to your computer and use it in GitHub Desktop.
メソッドの関数定義を展開して、近所のレシーバーを自動で入れる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: snippet -*- | |
# name: golang method receiver | |
# key: sf | |
# -- | |
func (${1:`(save-excursion | |
(let ((re "^func (\\([^\\)]*\\))")) | |
(cond | |
((or | |
(re-search-backward re nil t) | |
(re-search-forward re nil t)) | |
(match-string 1)) | |
(t ""))))`}) ${2:name} (${3:args}) ${4:result-type} { | |
$0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment