Sublime Forum

AsAbove

#1

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:

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: github.com/spadgos/sublime-AsAbove

0 Likes

#2

ctrl+shift+d does this. No?

0 Likes

#3

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

Here’s a better example:

[code]
// imagine the | is the cursor
abcdefg
abc|

// press Ctrl+shift+’
abcdefg
abcd|

// press Ctrl+shift+’
abcdefg
abcde|[/code]

0 Likes

#4

ah! ok, now make sense :smile:

0 Likes