Skip to content

Instantly share code, notes, and snippets.

@fabiomontefuscolo
Created September 26, 2014 20:14
Show Gist options
  • Save fabiomontefuscolo/7006641160356ac00bf4 to your computer and use it in GitHub Desktop.
Save fabiomontefuscolo/7006641160356ac00bf4 to your computer and use it in GitHub Desktop.
My Sublime 3 conf files.
# -*- coding: utf-8 -*-
import hashlib
import sublime
import sublime_plugin
class Md5fyCommand(sublime_plugin.TextCommand):
def run(self, edit, *args):
for region in self.view.sel():
if not region.empty():
s = self.view.substr(region)
s = s.encode('utf-8')
s = hashlib.md5(s).hexdigest()
self.view.replace(edit, region, s)
class NumberingCommand(sublime_plugin.TextCommand):
def run(self, edit, *args):
i = 1
for region in self.view.sel():
if not region.empty():
s = self.view.substr(region)
s = '%d. %s' % (i, s)
self.view.replace(edit, region, s)
i = i + 1
[
{ "keys": ["ctrl+k", "ctrl+m"], "command": "md5fy" },
{ "keys": ["ctrl+k", "ctrl+n"], "command": "numbering" }
]
{
"installed_packages":
[
"GitGutter-Edge",
"Javascript Beautify",
"LESS",
"SublimeLinter",
"SublimeLinter-jshint",
"SublimeLinter-pep8"
]
}
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment