duydao / Text-Pastry

Extend the power of multiple selections in Sublime Text. Modify selections, insert numeric sequences, incremental numbers, generate uuids, date ranges, insert continuously from a word list and more.
MIT License
830 stars 46 forks source link

Add a command for ordinal numbers #79

Closed mkruselj closed 5 years ago

mkruselj commented 5 years ago

Would be nice/useful sometimes?

ord 3 6

results in:

third
fourth
fifth
sixth

Could also have a number+suffix version, perhaps:

ordnum 2 4

with this result:

2nd
3rd
4th
duydao commented 5 years ago

Hi @mkruselj, this is already possible by creating a new preset list called TextPastryPresets.json in your user packages directory. You can find the folder by Browsing Packages -> User and place the file there.

This is the default config as example.

Text pastry will add the list name as command. Using this example as TextPastryPresets.json in your user settings directory: { "presets": { "ordinal": ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th"] } } This will enable entering "ordinal" as command. The syntax would be the following:

ordinal 2 4

This will insert 2nd, 3rd and 4th if you have three selections.

You can create as many lists as you want and name them as you like!

Thanks for using Text Pastry!

mkruselj commented 5 years ago

Thanks!