├── .gitignore ├── README.md └── snippets └── coffee.snippets /.gitignore: -------------------------------------------------------------------------------- 1 | DS_Store 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Collection of Snippets of CoffeeScript for VIM 2 | 3 | ## Prerequisitos 4 | 5 | Before you can install the snippet, you must install [Vim Snippets](http://www.vim.org/scripts/script.php?script_id=2540) 6 | Really recommended have installed Vim syntax highlighting and indentation support. [Vim CoffeeScript](http://github.com/kchmck/vim-coffee-script) 7 | 8 | ## Installation: 9 | 10 | Clone this repo in some where: 11 | 12 | $ git clone git@github.com:carlosvillu/coffeScript-VIM-Snippets.git 13 | $ cd coffeScript-VIM-Snippets 14 | $ cp snippets/coffee.snippets ~/.vim/snippets/ 15 | 16 | Then restart your VIM 17 | -------------------------------------------------------------------------------- /snippets/coffee.snippets: -------------------------------------------------------------------------------- 1 | # Class 2 | snippet class 3 | class ${1:name} 4 | constructor: (${2:params...}) -> 5 | ${3://body...} 6 | 7 | # Funcion 8 | snippet fun 9 | ${1:function_name} = (${2:argumen}) -> 10 | ${3: //body...} 11 | 12 | # Asignation if 13 | snippet =if 14 | ${1:variable} = ${2:valor} if ${3:condition} 15 | 16 | # Asignation if and 17 | snippet ifand 18 | if ${1} and ${2} 19 | 20 | # Asignation if then else 21 | snippet =ifthen 22 | ${1: value} = if ${2:option} then ${3:asignation} else ${4:else} 23 | 24 | # Asignation or= 25 | snippet or= 26 | ${1:options} or= ${2:defaults} 27 | 28 | # Asignation forin 29 | snippet forin 30 | ${1:countdown} = (${2:num} for ${3:num} in ${4:[10..1]}) 31 | 32 | # Asignation forof 33 | snippet forof 34 | ${1:ages} = for ${2:key}, ${3:value} of ${4:yearsOld} 35 | key + " is " + value 36 | 37 | # Asignation while 38 | snippet while 39 | ${1:action()} while ${2:condition} 40 | 41 | # Asignation until 42 | snippet until 43 | ${1:action()} until ${2:condition} 44 | 45 | # Asignation forindo 46 | snippet forindo 47 | for ${1:filename} in ${2:list} 48 | do (${3:filename}) -> 49 | 50 | # Asignation try 51 | snippet try 52 | try 53 | ${1:expresion} 54 | catch error 55 | ${2:error} 56 | 57 | # Asignation tryfin 58 | snippet tryfin 59 | try 60 | ${1:expresion} 61 | catch error 62 | ${2:error} 63 | finally 64 | ${3:cleanAll()} 65 | 66 | # Asignation ?= 67 | snippet ?= 68 | ${1:speed} ?= ${2:75} 69 | 70 | # Asignation =? 71 | snippet =? 72 | ${1:footprints} = ${2:yetis} ? ${3:bear} 73 | 74 | # Asignation switch 75 | snippet switch 76 | switch ${1:day} 77 | when ${2:Mon} then ${3:go work} 78 | else ${4:go relax} 79 | 80 | # Asignation ## 81 | snippet ## 82 | ### 83 | ${1:comment} 84 | ### 85 | 86 | ## Jasmine Snippets 87 | ## Thibault NORMAND 88 | ## 89 | snippet desc 90 | # ${1:Specification} 91 | 92 | describe '${2:Model or When ...}', -> 93 | ${3} 94 | return 95 | 96 | snippet it 97 | it '${1:Should ...}', -> 98 | ${2} 99 | 100 | snippet exp 101 | expect(${1:predicate}) 102 | 103 | snippet exp= 104 | expect(${1:predicate}).toEqual ${2:value} 105 | 106 | snippet expmatch 107 | expect(${1:predicate}).toMatch /${2:regex}/ 108 | 109 | snippet expdef 110 | expect(${1:predicate}).toBeDefined 111 | 112 | snippet expnull 113 | expect(${1:predicate}).toBeNull 114 | 115 | snippet exptrue 116 | expect(${1:predicate}).toBeThruthy 117 | 118 | snippet expfalse 119 | expect(${1:predicate}).toBeFalsy() 120 | 121 | snippet expcon 122 | expect(${1:predicate}).toContain ${2:value} 123 | 124 | snippet befe 125 | # Configuration 126 | beforeEach -> 127 | ${1} 128 | 129 | snippet spyon 130 | spyOn ${1:object}, ${2:method} 131 | 132 | snippet expcall 133 | expect(${1:predicate}).wasCalled 134 | 135 | snippet expncall 136 | expect(${1:predicate}).wasNotCalled 137 | 138 | snippet expcallw 139 | expect(${1:predicate}).wasCalledWith ${2:arguments} 140 | 141 | snippet expncallw 142 | expect(${1:predicate}).wasNotCalledWith ${2:arguments} 143 | --------------------------------------------------------------------------------