From fae08427b0f731174d535fb6b0a6d6239e238633 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 9 May 2012 18:22:48 +0200 Subject: [PATCH 1/9] expand "cons" to "console.log('');" --- README.md | 1 + Snippets/cons.tmSnippet | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Snippets/cons.tmSnippet diff --git a/README.md b/README.md index 7c72ee4..220ea7c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Important: Change your current grammar to "JavaScript Node" (short cut: Shift+Ct Others: * app => if (module.id == require.main.id) { .. } +* cons => console.log(''); ## Installation diff --git a/Snippets/cons.tmSnippet b/Snippets/cons.tmSnippet new file mode 100644 index 0000000..44921ec --- /dev/null +++ b/Snippets/cons.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + console.log(${1:''}); + + name + cons + scope + source.js.node + tabTrigger + cons + uuid + 959A3067-5070-4F88-B5AB-02D266A8E381 + + From d00ffe02689396f746159c94377cc420e44fde9a Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 9 May 2012 19:28:11 +0200 Subject: [PATCH 2/9] - "Fix" function snippet to not include a space between the function name and argument list. - regen plist --- Snippets/function.tmSnippet | 18 ++++++++++++++++++ info.plist | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 Snippets/function.tmSnippet diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet new file mode 100644 index 0000000..5999bc4 --- /dev/null +++ b/Snippets/function.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + function ${1:function_name}(${2:argument}) { + ${0:// body...} +} + name + function + scope + source.js + tabTrigger + fun + uuid + F0E4FB6A-4878-48C6-A777-62438DF1E14F + + diff --git a/info.plist b/info.plist index 3ee62d7..c77c1cd 100644 --- a/info.plist +++ b/info.plist @@ -79,6 +79,9 @@ D63101FB-D494-44CD-BE60-F26F68FF6BE3 D2F95B9E-1273-477A-9018-05C91E8653B4 483223F6-814F-4836-A105-DE8F6BA56281 + B79BFD7D-FF06-402C-B2BA-F80EC68834D1 + 959A3067-5070-4F88-B5AB-02D266A8E381 + F0E4FB6A-4878-48C6-A777-62438DF1E14F uuid B4B8CCA9-FD56-471B-B7D8-A7B1A1B06E78 From da81613ececc9bbfdc4a6e2eee8d92f9ca508b6d Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 9 May 2012 19:37:06 +0200 Subject: [PATCH 3/9] - Fix scope of new function snippet - Don't insert an extra new line after console.log() - add setTimeout snippet --- Snippets/cons.tmSnippet | 3 +-- Snippets/function.tmSnippet | 2 +- Snippets/settimeout.tmSnippet | 16 ++++++++++++++++ info.plist | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Snippets/settimeout.tmSnippet diff --git a/Snippets/cons.tmSnippet b/Snippets/cons.tmSnippet index 44921ec..b0b3291 100644 --- a/Snippets/cons.tmSnippet +++ b/Snippets/cons.tmSnippet @@ -3,8 +3,7 @@ content - console.log(${1:''}); - + console.log(${1:''}); name cons scope diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet index 5999bc4..4fcc1ff 100644 --- a/Snippets/function.tmSnippet +++ b/Snippets/function.tmSnippet @@ -9,7 +9,7 @@ name function scope - source.js + source.js.node tabTrigger fun uuid diff --git a/Snippets/settimeout.tmSnippet b/Snippets/settimeout.tmSnippet new file mode 100644 index 0000000..7e373b3 --- /dev/null +++ b/Snippets/settimeout.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + setTimeout(${1:function}, ${2:n}); + name + settimeout + scope + source.js.node + tabTrigger + set + uuid + 1B9B9A18-2314-4FB1-ACF5-3A8A18AE9988 + + diff --git a/info.plist b/info.plist index c77c1cd..292ca87 100644 --- a/info.plist +++ b/info.plist @@ -82,6 +82,7 @@ B79BFD7D-FF06-402C-B2BA-F80EC68834D1 959A3067-5070-4F88-B5AB-02D266A8E381 F0E4FB6A-4878-48C6-A777-62438DF1E14F + 1B9B9A18-2314-4FB1-ACF5-3A8A18AE9988 uuid B4B8CCA9-FD56-471B-B7D8-A7B1A1B06E78 From aae5badf0b4559ea77aa7485485b66576ad1fb8e Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 9 May 2012 19:44:08 +0200 Subject: [PATCH 4/9] I made you a snippet, but TextMate eated it. --- Snippets/function.tmSnippet | 2 +- info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet index 4fcc1ff..0f29193 100644 --- a/Snippets/function.tmSnippet +++ b/Snippets/function.tmSnippet @@ -13,6 +13,6 @@ tabTrigger fun uuid - F0E4FB6A-4878-48C6-A777-62438DF1E14F + EBED7197-DE57-4621-836D-A1AA30BEFA89 diff --git a/info.plist b/info.plist index 292ca87..0078a84 100644 --- a/info.plist +++ b/info.plist @@ -81,8 +81,8 @@ 483223F6-814F-4836-A105-DE8F6BA56281 B79BFD7D-FF06-402C-B2BA-F80EC68834D1 959A3067-5070-4F88-B5AB-02D266A8E381 - F0E4FB6A-4878-48C6-A777-62438DF1E14F 1B9B9A18-2314-4FB1-ACF5-3A8A18AE9988 + EBED7197-DE57-4621-836D-A1AA30BEFA89 uuid B4B8CCA9-FD56-471B-B7D8-A7B1A1B06E78 From d66ad7e3a3b73af4e15d9eb991669d24a59f52cb Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 9 May 2012 19:48:11 +0200 Subject: [PATCH 5/9] sync docs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 220ea7c..1f84595 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Others: * app => if (module.id == require.main.id) { .. } * cons => console.log(''); +* fun => function function_name(argument) { // body...} +* set => setTimeout(function, n); ## Installation From fd0e335ee6f389aba17e80156bc13355ce2493a0 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 10 May 2012 19:15:21 +0200 Subject: [PATCH 6/9] process.mixin() has been removed from node for a while now. --- README.md | 1 - Snippets/mixin.tmSnippet | 18 ------------------ info.plist | 1 - 3 files changed, 20 deletions(-) delete mode 100644 Snippets/mixin.tmSnippet diff --git a/README.md b/README.md index 1f84595..2a628d9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Important: Change your current grammar to "JavaScript Node" (short cut: Shift+Ct * Cmd+R - run current file within node * req => var sys = require('sys'); -* mixin => process.mixin(exports, {...}); * exp => exports.func_name = function() {...}; * process snippets * .lis - .addListener(...) diff --git a/Snippets/mixin.tmSnippet b/Snippets/mixin.tmSnippet deleted file mode 100644 index 9d22424..0000000 --- a/Snippets/mixin.tmSnippet +++ /dev/null @@ -1,18 +0,0 @@ - - - - - content - process.mixin(${1:exports}, { - $0 -}); - name - mixin - scope - source.js.node - tabTrigger - mixin - uuid - E114B311-9CD7-422E-BBDB-DF8930F5C5CD - - diff --git a/info.plist b/info.plist index 0078a84..650c348 100644 --- a/info.plist +++ b/info.plist @@ -62,7 +62,6 @@ 17076F45-FE22-4123-AD00-0C8E31BC2EB8 5ECAB6F6-77CD-4A15-A646-BE4B01B3944F 59AF7588-E4A5-4BD4-8CF0-50EDB8068520 - E114B311-9CD7-422E-BBDB-DF8930F5C5CD 5997D597-577F-4521-86D8-7119B0D86D1B 180C087D-09AE-4F15-8861-2ED02DDD673F 9D08A939-64FB-42F6-BE49-774D1BFB3954 From abaa5b0b6b20fc2324cbdb3325e6e51324c6881f Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 10 May 2012 19:25:51 +0200 Subject: [PATCH 7/9] Fix a warning, 'sys' module is now called 'util', so adjust the snippet accordingly. --- Snippets/require.tmSnippet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snippets/require.tmSnippet b/Snippets/require.tmSnippet index 74a3fd0..bbf06d3 100644 --- a/Snippets/require.tmSnippet +++ b/Snippets/require.tmSnippet @@ -3,7 +3,7 @@ content - var ${2:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}} = require('${1:sys}')$0; + var ${2:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}} = require('${1:util}')$0; name require scope From 6f22692b6c4a8e1daa199936d4e97ca3f8821cb2 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 10 May 2012 19:29:26 +0200 Subject: [PATCH 8/9] Sync docs too --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a628d9..936d730 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Important: Change your current grammar to "JavaScript Node" (short cut: Shift+Ctrl+Alt+N) * Cmd+R - run current file within node -* req => var sys = require('sys'); +* req => var util = require('util'); * exp => exports.func_name = function() {...}; * process snippets * .lis - .addListener(...) From 1569577ff9d1ec11526c061d2af549d4ff88463d Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 10 May 2012 19:34:17 +0200 Subject: [PATCH 9/9] ADd to list of contributors. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 936d730..fb0ddce 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,12 @@ Alternately, in TextMate, from your drop down menu, select Bundles -> Bundle Edi The Node.JS TM Bundle is currently authored by Dr Nic Williams. Contributors and co-maintainers are welcome. * **Dr Nic** - Author/Main contributor +* **Jasper Lievisse Adriaanse** - Contributor ## License Copyright (c) 2009-2010 Dr Nic Williams, Mocra +Copyright (c) 2012 Jasper Lievisse Adriaanse Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal