Sublime Forum

ST2/ST3 - String Utilities (useful string functions)

#1

StringUtilities is a Sublime Text 2 plugin, which adds to the editor useful string functions like:

Convert Tabs to Spaces
Convert Spaces to Tabs
Convert Chars to Html Entities
Convert Html Entities to Chars
Convert Camel Case <-> Underscores
Convert To Unicode Notation
Convert From Unicode Notation
Convert To Base64
Convert From Base64
Convert To Hex
Convert From Hex
Convert HTML Color From Hex To RGB
Convert HTML Color From RGB To Hex
Calculate Selection MD5
Calculate Selection SHA1
Convert Unixtime <-> Datetime
Insert Current Datetime
Insert Short Password
Insert Medium Password
Insert Long Password
Insert Internal IP Address
Insert External IP Address

ST2 - github.com/akalongman/sublimete … gutilities
ST3 - github.com/akalongman/sublimete … s/tree/ST3

0 Likes

#2

Plugin ported on ST3

0 Likes

#3

This post removed since the commands suggested were already implemented natively by Sublime.

0 Likes

#4

If you want, create pull request on github and I will merge it

0 Likes

#5

This post removed since the commands suggested were already implemented natively by Sublime.

0 Likes

#6

Please don’t overwrite user keys. Or, if you do, please add an option to disable default keys…

0 Likes

#7

[quote=“robertcollier4”]Here are two more that I just wrote that come in handy.

{ "keys": "ctrl+shift+alt+right"], "command": "select_to_endofline" }, { "keys": "ctrl+shift+alt+left"], "command": "select_to_begofline" },

[code]import sublime, sublime_plugin

class SelectToEndoflineCommand(sublime_plugin.TextCommand):
def run(self, edit):
for thisRegion in self.view.sel():
self.view.sel().add(sublime.Region(thisRegion.begin(), self.view.line(thisRegion.begin()).end()))

class SelectToBegoflineCommand(sublime_plugin.TextCommand):
def run(self, edit):
for thisRegion in self.view.sel():
self.view.sel().add(sublime.Region(thisRegion.end(), self.view.line(thisRegion.begin()).begin()))
[/code][/quote]

I suppose that it’s equivalent (but way more complicated) to:

{ "keys": "ctrl+shift+alt+left"], "command": "move_to", "args": {"to": "hardbol", "extend": true} }, { "keys": "ctrl+shift+alt+right"], "command": "move_to", "args": {"to": "hardeol", "extend": true} },

0 Likes

#8

Closed the pull request. Seems those custom commands were completely unnecessary since they are already implemented natively by Sublime.

0 Likes

#9

Excelent plugin. But i have one maybe basic question.

For example:

I have some symbol “:slight_smile:” -> unicode value is -> \263B and \u263B (its important for css and js coding) and html entity is &#9787
with this plugin I was able to convert to unicode but not to the HTML entity, is it possible?

Wanted methods

  1. :slight_smile: -> :slight_smile: (symbol to entity)
  2. \263B -> :slight_smile: (unicode hex value to entity )
    **
    Both solutions bidirectionally of course :smile:**

Btw. its best plugin for for string operation what i found, but this triffle is missing (maybe i dont know how to do it in plugin …)

0 Likes

#10

hasher is the only plugin for html entities that works. Has an option to encode just < > " ', or all which will turn your smile to :slight_smile:

0 Likes

#11

[quote=“Kcko”]Excelent plugin. But i have one maybe basic question.

For example:

I have some symbol “:slight_smile:” -> unicode value is -> \263B and \u263B (its important for css and js coding) and html entity is &#9787
with this plugin I was able to convert to unicode but not to the HTML entity, is it possible?

Wanted methods

  1. :slight_smile: -> :slight_smile: (symbol to entity)
  2. \263B -> :slight_smile: (unicode hex value to entity )
    **
    Both solutions bidirectionally of course :smile:**

Btw. its best plugin for for string operation what i found, but this triffle is missing (maybe i dont know how to do it in plugin …)[/quote]

I will add this feature

0 Likes

#12

Plugin updated. Added some useful functionality

0 Likes