Home Download Buy Blog Forum Support

AsAbove

AsAbove

Postby spadgos on Wed Nov 09, 2011 5:59 pm

A small plugin which simply duplicates the character directly above your cursor.

The plugin adds a single hotkey of: Ctrl+Shift+' (think of it like using double quotes to indicate "same as above" in written text)

I wrote this because I often had to write code like this:

Code: Select all
var UrlReader = require("lib/net/url/Reader"),
    UrlWriter = require("lib/net/url/Writer");

As you get to the "=" sign, with AsAbove you can just hit the hotkey as many times as you need rather than breaking your flow to move up and copy to the clipboard.

It works with multiple cursors, as well as with selections and multiple selections.

Installation via Package Control.
Repo here: https://github.com/spadgos/sublime-AsAbove
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: AsAbove

Postby iamntz on Wed Nov 09, 2011 6:03 pm

ctrl+shift+d does this. No?
iamntz
 
Posts: 898
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: AsAbove

Postby spadgos on Wed Nov 09, 2011 6:10 pm

No, that duplicates the entire line, whereas this will just insert a single character.

Here's a better example:

Code: Select all
// imagine the | is the cursor
abcdefg
abc|

// press Ctrl+shift+'
abcdefg
abcd|

// press Ctrl+shift+'
abcdefg
abcde|
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: AsAbove

Postby iamntz on Wed Nov 09, 2011 6:17 pm

ah! ok, now make sense :)
iamntz
 
Posts: 898
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 11 guests