250 Commits

Author SHA1 Message Date
Jesper Skovgaard Nielsen
9b02aaf865 Make construct snippet PSR compliant. 2014-01-08 10:14:28 +01:00
Joe Lencioni
2f66a3fc2b Re-order JS for snippets
Now that we have separated the two `for` loop snippet triggers by
changing the one that counts down from "for" to "ford", it feels more
and more like "ford" is a variant of "for" so I am moving it after it in
the file. Also, alphabetical.
2014-01-06 22:24:13 -08:00
Joe Lencioni
23d7ded754 Simplify JS for snippet bodies
As suggested by @SirVer[1], having `Things[i]` be pre-populated in the
body of the `for` loop snippets is not very useful given the merits of
autocompletion. This commit simplifies these bodies by simply using
`${VISUAL}$0`.

[1]: https://github.com/SirVer/ultisnips/pull/123/files#r8686533
2014-01-06 22:24:13 -08:00
Joe Lencioni
983d494752 Add "b" options to JS for and ford snippets
`for` loops usually appear at the beginning of the line. This commit
makes these snippets more context-aware by adding the "b" option that
prevents them from being triggered if they are preceded with something
other than whitespace, as suggested by @SirVer[1].

[1]: https://github.com/SirVer/ultisnips/pull/123/files#r8686514
2014-01-06 22:24:12 -08:00
Joe Lencioni
5c36a8945c Change JS for counting down trigger from for to ford
As suggested by @SirVer[1], this commit changes the trigger of the
JavaScript `for` snippet that counts down from "for" to "ford". Since
"for" is used pretty often, this will prevent people from needing to
select which one they want from the menu each time.

[1]: https://github.com/SirVer/ultisnips/pull/123/files#r8686514
2014-01-06 22:23:24 -08:00
Joe Lencioni
6fa0644685 Improve descriptions of JS for snippets
More specifically than "faster" and not faster, these snippets count
down and count up, respectively. Adding this information to the
descriptions will help people make the correct decision.
2014-01-06 08:25:18 -08:00
Joe Lencioni
98f88de976 Increase scope of JS for snippet placeholder
The `Things.length` part of the JS `for` snippet previously did not
include the `.length` portion. Using some regex replacement, we can
include this bit in the placeholder while still only using the `Things`
bit inside the `for` loop. This should make the snippet slightly more
pleasant to use.
2014-01-06 08:22:54 -08:00
Joe Lencioni
bd0c576bff Use length caching in JS for snippet
The previous version of this snippet referenced the object's length on
each iteration of the loop. This adds unnecessary overhead, causing the
loop to be slower. While this will not make much of a difference in many
cases, if the for loop was to be used on a large object or in a tight
loop, it would degrade performance.

Perhaps more importantly, if you were to not cache the length of a live
query, such as DOM queries, you would see significant performance
degradation. If nothing else, this adjustment to the snippet sets things
up for success in more scenarios.
2014-01-06 08:20:54 -08:00
Joe Lencioni
43a78a8273 Add "b" trigger option to JS console snippets
The "b" trigger option will require that the snippet be expanded only if
it is at the "beginning of the line", that is, only whitespace may
precede the tab trigger.

As suggested by @SirVer[1], this commit adds the "b" tab trigger option
to all of the JavaScript console API snippets.

[1]: https://github.com/SirVer/ultisnips/pull/122/files#r8665940
2014-01-06 07:46:16 -08:00
Joe Lencioni
3c461925b9 Improve console.timeStamp snippet
The console.timeStamp method is camelCased, so I made the description
match the contents. Additionally, there was a missing semicolon at the
end of the line that I added.
2014-01-05 08:03:49 -08:00
Joe Lencioni
bf0965fb6e Add missing console API methods to JS snippets
This commit adds snippets for the following console API methods that
were missing:

  - console.clear
  - console.dir
  - console.dirxml
  - console.groupCollapsed
  - console.info
  - console.profile
  - console.table

I left out console.debug and console.exception since they are simply
aliases for console.log and console.error.

Information about the console API can be found at:

  https://developers.google.com/chrome-developer-tools/docs/console-api
  https://developer.mozilla.org/en-US/docs/Web/API/console
2014-01-05 08:03:49 -08:00
Joe Lencioni
b9cdc97ef9 Alphabetize JavaScript console snippets
Ordering these snippets alphabetically based on their descriptions makes
it easier to find what you are looking for and to notice any snippets
that may be missing from the list.
2014-01-05 08:03:49 -08:00
Holger Rapp
44fd0c704a Do not use has_key in snippets, as this is no longer available in python3. 2013-12-15 12:32:04 +01:00
Holger Rapp
cb15778473 html: added w in useful places. Patch by Julian Martin Grinblat. 2013-12-14 14:48:52 +01:00
Holger Rapp
179af2f970 Merge pull request #115 from heytrav/master
perl: use parent in place of base and uncuddle "else" as suggested by the Perl Best Practices book.
2013-12-02 22:32:31 -08:00
Holger Rapp
9588754e73 Merge pull request #117 from mygoare/patch-2
ruby: fix `each_slice` can't trigger
2013-12-02 22:30:18 -08:00
Goare Mao
c07996bd22 fix each_slice can't trigger 2013-12-03 11:18:21 +08:00
Goare Mao
e45c9a8041 fix a little problem 2013-12-02 19:23:05 +08:00
Travis Holton
7265bcb5c1 use parent in place of "base" 2013-12-02 20:27:54 +13:00
Travis Holton
af9f42c539 General Perl Best Practice stuff: uncuddle "else", localise $@
use $exception in place of $e
2013-12-02 20:27:39 +13:00
Loknan Nanyak
6012a2d914 Added ${2: !v g:snips_author} to snippet 'class'
The php.snippet was changed on line 219 to:
"@author ${2:`!v g:snips_author`}", to insert author name for php classes.
2013-11-27 15:26:10 +01:00
Holger Rapp
4b91492280 Merge pull request #113 from AntoineD/dev
Python: for loop.
2013-11-20 07:09:34 -08:00
Antoine Dechaume
9ebe2b6886 update after SirVer review 2013-11-19 21:59:12 +01:00
Antoine Dechaume
4f6bcae1f9 Revert "python: add TODO snippet"
This reverts commit 2675e55dc1fef184539757d8d5f5e190ae0f1e49.
2013-11-19 21:56:41 +01:00
Holger Rapp
ac45d98767 Merge pull request #112 from dsimmons/enhancement/go-snippets
go: added struct, json and interface snippets.
2013-11-19 07:00:14 -08:00
Antoine Dechaume
2675e55dc1 python: add TODO snippet 2013-11-18 21:48:39 +01:00
Antoine Dechaume
0e6529fbb0 python: add for loop snipet 2013-11-18 21:48:20 +01:00
Dan Simmons
8006112de9 Added a few useful Go snippets that I've been using locally. 2013-11-18 10:52:02 -05:00
yeer
c2f96bd7c1 Update go.snippets
add select statement
2013-11-16 10:49:56 +08:00
Holger Rapp
1600f5bbea php: Bug fixes for php by Ye Yen. 2013-11-09 17:07:08 +01:00
Noa Johan Thorstensson
12c807607a Removed mistake 2013-10-30 16:47:10 +01:00
Noa Johan Thorstensson
d61df48add Added img snip 2013-10-29 07:44:57 +01:00
Noa Johan Thorstensson
038cfdbd8f Added img snip and improved block snip 2013-10-29 07:43:44 +01:00
Holger Rapp
331eae1529 Feature: a option for converting into ASCII before transforming. Patch by rgiot. 2013-10-23 08:16:59 +02:00
Holger Rapp
ef2c657721 Merge branch 'master' of git://github.com/rgiot/ultisnips into rgiot-master 2013-10-21 06:30:38 +02:00
Nathan Pearson
1a496b43a3 Changes ruby do block args so they are inside the pipe symbols 2013-10-20 19:28:43 -07:00
Holger Rapp
7a6abe02ec Merge pull request #102 from phux/master
php: added __construct() snippet
2013-10-06 22:47:33 -07:00
Holger Rapp
1097b280a3 Made detection of sh more stable. 2013-10-03 13:10:03 +02:00
Jan Mollowitz
b51800cd0c php: added b flag to construct snippet 2013-10-02 22:21:02 +02:00
Romain Giot
a150220cf2 Allow to use the flag 'a' in the transformation commands.
This way, in a Latex file written with accentueted letters, the label use non accentueted letters instead of _.
2013-10-02 13:48:12 +02:00
Jan Mollowitz
839e3f3ebb php snippets: added __construct() snippet 2013-09-27 16:22:51 +02:00
Ian Oxley
421cb8a68a JSHint complained about 'Unnecessary semicolon'.
JSHint complained about the semicolons at the end of the for loop
snippets, so I've removed the semicolons after the for loop closing braces.
2013-09-10 14:59:55 +01:00
Holger Rapp
d5f4e259e5 Merge pull request #99 from amurdaca/patch-1
Javascript: Remove space between function declaration and arguments list.
2013-09-01 22:12:24 -07:00
Holger Rapp
9c8582f061 Merge pull request #97 from nulpunkt/master
Php: Make class snippet PSR-0 compliant
2013-09-01 22:08:12 -07:00
Antonio Murdaca
ccabc82ed4 Remove space between function declaration and arguments list (jshint complains too) 2013-08-29 18:20:38 +02:00
Ian Oxley
bc322038d2 Replaced 'RequireJS' with 'AMD'.
These snippets are more general AMD snippets, rather than being specific
to RequireJS i.e. they can be used by anyone using an AMD script loader,
not just RequireJS.
2013-08-20 11:42:10 +01:00
Jesper Skovgård Nielsen
25abb55a5e Make class snippet PSR-0 compliant
When making a file classes ViewHelper.php, you would expect the classname to be ViewHelper, not Viewhelper.
2013-08-19 11:19:54 +02:00
Ian Oxley
ccc524c2e9 Moved RequireJS snippets into javascript.snippets.
The two snippets are at the end of javascript.snippets, and the javascript_requirejs.snippets file has been deleted.
2013-08-15 16:38:09 +01:00
Ian Oxley
f8a5dfb05b requirejs JavaScript snippets.
Added 2 snippets: for the define and require functions.
2013-08-09 16:19:54 +01:00
Nicolas Wu
8e8a55455d Add lhaskell support 2013-07-30 09:45:20 +01:00