├── README.md ├── nudge-changevalue.sketchplugin ├── nudge-down.sketchplugin ├── nudge-left.sketchplugin ├── nudge-right.sketchplugin └── nudge-up.sketchplugin /README.md: -------------------------------------------------------------------------------- 1 | # gb-sketch-nudge 2 | Quick nudge by a customizable number of pixels 3 | 4 | ![](https://scontent-2.2914.fna.fbcdn.net/hphotos-xpa1/v/t1.0-9/1509909_10153616010600550_7034775083443746872_n.jpg?oh=380f7edbd41fdde69064249eb69e3eee&oe=556234BA) 5 | 6 | ## Updates 7 | 8 | ##### Oct 27, 2016 9 | * Changing shortcut to ctrl shift = for setting the vakue to avoid conflict with segemented circle plugin 10 | 11 | ##### Jan 27, 2015 12 | * Changing shortcut to ctrl shift to avoid conflict with move to back/front 13 | * Auto-updating inspector 14 | 15 | ## Description 16 | For those who want more then just nudging by 1px (arrow keys) or 10px (shift + arrow keys). For example in a recent project things were usually moved in multiples of 16px. This plugin saved hours. 17 | 18 | ctrl-shift plus ↓ ← ↑ → to nudge the selection by n pixels, where n is any number. 19 | ctrl-shift-= (equal) is used to change this number. 20 | 21 | Preserves last used value across sessions. 22 | -------------------------------------------------------------------------------- /nudge-changevalue.sketchplugin: -------------------------------------------------------------------------------- 1 | //set offset value for up down left right commands (ctrl shift =) 2 | 3 | var def = [NSUserDefaults standardUserDefaults] 4 | var key = "sk_offset" 5 | var os = [def objectForKey:key] 6 | if(os == nil) os = "8" //retrieve value from defaults, if none set starting at 8 7 | 8 | var input = [doc askForUserInput:"Offset value?" initialValue:os] 9 | [def setObject:input forKey:key]//set defaults to this value 10 | -------------------------------------------------------------------------------- /nudge-down.sketchplugin: -------------------------------------------------------------------------------- 1 | // move down (ctrl shift ↓) 2 | 3 | var def = [NSUserDefaults standardUserDefaults] 4 | var key = "sk_offset" 5 | var os = [def objectForKey:key] 6 | if(os == nil) { 7 | os = [doc askForUserInput:"Offset value?" initialValue:"8"] 8 | [def setObject:os forKey:key]//set defaults to this value 9 | } 10 | os = Number(os) 11 | 12 | for (var i=0; i