Skip to content
Browse files

first commit

  • Loading branch information...
0 parents commit 961a7ee393b779ff8c7adf75d40aed94caf59637 @billymoon committed Mar 1, 2012
14 Context.sublime-menu
@@ -0,0 +1,14 @@
+[
+ {
+ "caption":"Lorem Ipsum...",
+ "command": "lorem_ipsum",
+ "mnemonic": "LI",
+ "children":
+ [
+ {"command": "lorem_ipsum", "caption": "a bit", "args":{"qty":5}},
+ {"command": "lorem_ipsum", "caption": "some", "args":{"qty":15}},
+ {"command": "lorem_ipsum", "caption": "lots", "args":{"qty":30}},
+ {"command": "lorem_ipsum", "caption": "stick shake", "args":{"qty":200}}
+ ]
+ }
+]
3 Default (Linux).sublime-keymap
@@ -0,0 +1,3 @@
+[
+ { "keys": ["control+alt+l"], "command": "lorem_ipsum" }
+]
3 Default (OSX).sublime-keymap
@@ -0,0 +1,3 @@
+[
+ { "keys": ["alt+command+l"], "command": "lorem_ipsum" }
+]
3 Default (Windows).sublime-keymap
@@ -0,0 +1,3 @@
+[
+ { "keys": ["control+alt+l"], "command": "lorem_ipsum" }
+]
27 LoremIpsum.py
@@ -0,0 +1,27 @@
+import sublime, sublime_plugin
+import random
+
+class LoremIpsumCommand(sublime_plugin.TextCommand):
+ def run(self, edit, qty = 10):
+ selections = self.view.sel()
+ for selection in selections:
+ # always start with Lorem ipsum
+ para = "Lorem ipsum ";
+ # words from the original Lorum ipsum text
+ words = "dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum".split()
+
+ from random import choice
+ for x in range(random.randint(qty - qty/2, qty + qty/2)):
+ para += choice(words) + " "
+ para += choice(words) + ". "
+ editor = self.view.begin_edit()
+
+ # erase region
+ self.view.erase(editor, selection)
+ # insert para before current cursor position
+ self.view.insert(editor, selection.begin(), para)
+
+ # insert para over the top of selection, but remaining selected (not behavior we want)
+ # self.view.replace(editor, self.view.sel()[0], para)
+
+ self.view.end_edit(editor)
BIN LoremIpsum.pyc
Binary file not shown.
26 Main.sublime-menu
@@ -0,0 +1,26 @@
+[
+ {
+ "id":"edit",
+ "children":
+ [
+ {
+ "id":"text",
+ "children":
+ [
+ {
+ "caption":"Lorem Ipsum...",
+ "command": "lorem_ipsum",
+ "mnemonic": "LI",
+ "children":
+ [
+ {"command": "lorem_ipsum", "caption": "a bit", "args":{"qty":5}},
+ {"command": "lorem_ipsum", "caption": "some", "args":{"qty":15}},
+ {"command": "lorem_ipsum", "caption": "lots", "args":{"qty":30}},
+ {"command": "lorem_ipsum", "caption": "stick shake", "args":{"qty":200}}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
33 README.markdown
@@ -0,0 +1,33 @@
+# LoremIpsum
+
+An extension for Sublime Text 2.
+
+It allow you to Insert Lorem Ipsum in the editor via menu items or keyboard shortcut.
+
+Just press the shortcut key (Alt+Command+l on OSX, Control+Alt+l on Windows/Linux) to add Lorem Ipsum text. Keep pressing to add more.
+
+Alternatively, select how much text you want from the menu item.
+
+## Features
+
+1. Uses only words from the original Lorem ipsum text.
+2. Randomly generates text from selection of words
+3. Always starts with `Lorem ipsum`
+4. Leaves the inserted text un-selected, so you can insert some more straight away (rapid tapping to get as much lorem as you want)
+5. Shortcut key, `Edit -> Text -> Lorem Ipsum...` sub-menu, and context menu activation
+6. Variable size of text from just `a bit` to more than you can shake a stick at!
+
+## Install
+
+### Package Control
+
+The easiest way to install this is with [Package Control](http://wbond.net/sublime\_packages/package\_control).
+
+ * If you just went and installed Package Control, you probably need to restart Sublime Text 2 before doing this next bit.
+ * Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
+ * Select "Package Control: Install Package" (it'll take a few seconds)
+ * Select LoremIpsum when the list appears.
+
+Package Control will automatically keep Git up to date with the latest version.
+
+If you have some problems or improvements with it, contact me via GitHub.

0 comments on commit 961a7ee

Please sign in to comment.
Something went wrong with that request. Please try again.