local snippets added

This commit is contained in:
Sameer Rahmani 2015-07-09 16:37:35 +04:30
parent 7e92a7078e
commit dbdc7715b0
9 changed files with 76 additions and 2 deletions

View File

@ -43,6 +43,8 @@
(ability yas ()
"Snippet configuration."
(let ((snippet_home (concat fg42-home "/lib/snippets")))
(setq yas-snippet-dirs (list snippet_home)))
(yas-global-mode 1))
(ability project-management ()

View File

@ -7,10 +7,12 @@ Home page:
\thttp://fg42.lxsameer.com
Credits:
\tSameer Rahmani (lxsameer)
\tSameer Rahmani (@lxsameer)
\tDanial Parsi (@intuxticated)
\tAmir Houghangi
\tNima Nazari (niman)
\tDanial Parsi (intuxticated)
\tKeyvan Hedayati (k1-hedayati)
\tBehnam Khan Beigi (@yottanami)
"
"About FG42")

View File

@ -27,6 +27,9 @@
(require 'fpkg)
(require 'fg42/base)
(defvar fg42-home (getenv "FG42_HOME")
"The pass to fg42-home")
(defun fg42-initialize ()
"Initialize FG42 editor."
(fpkg-initialize)

View File

@ -0,0 +1,13 @@
# name: belongs_to
# key: bt
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)
# condition: (featurep 'flymake-json)
# contributor: Sameer Rahmani <lxsameer@gnu.org>
# --
{
"name": "$1",
"type": "belongs_to",
"bulk": ${2:$$(yas-choose-value '("true" "false"))},
"to": "${1:$(pluralize-string yas-text)}"
},
$0

View File

@ -0,0 +1,12 @@
# name: field
# key: ff
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)
# condition: (featurep 'flymake-json)
# contributor: Sameer Rahmani <lxsameer@gnu.org>
# --
{
"name": "$1",
"type": "${2:$$(yas-choose-value '("string" "integer" "datetime" "float" "image" "in" "belongs_to" "has_many"))}",
"bulk": ${3:$$(yas-choose-value '("true" "false"))}
},
$0

View File

@ -0,0 +1,13 @@
# name: has_many
# key: hm
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)
# condition: (featurep 'flymake-json)
# contributor: Sameer Rahmani <lxsameer@gnu.org>
# --
{
"name": "$1",
"type": "has_many",
"bulk": ${2:$$(yas-choose-value '("true" "false"))},
"to": "${1:$(pluralize-string yas-text)}"
},
$0

14
lib/snippets/js-mode/in Normal file
View File

@ -0,0 +1,14 @@
# name: in
# key: in
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)
# condition: (featurep 'flymake-json)
# contributor: Sameer Rahmani <lxsameer@gnu.org>
# --
{
"name": "$1",
"type": "in",
"bulk": ${2:$$(yas-choose-value '("true" "false"))},
"to": [
$0
]
},

View File

@ -0,0 +1,14 @@
# name: resource
# key: resource
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)
# condition: (featurep 'flymake-json)
# contributor: Sameer Rahmani <lxsameer@gnu.org>
# --
{
"name": "$1",
"fields": [
$0
],
"no_filter": ${2:$$(yas-choose-value '("true" "false"))},
"title-field": "$3"
}

View File

@ -0,0 +1 @@
html-mode