JavaScriptExtractFunction
A lightweight plugin for Sublime Text 3 to extract a function from a selected piece of Javascript code
Details
Installs
- Total 3K
- Win 2K
- Mac 309
- Linux 343
May 31 | May 30 | May 29 | May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 0 | 1 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Javascript Extract Function
This is a lightweight Sublime Text 3 plugin that will extract and create a function from the highlighted text. It works in three steps:
- Highlight the text
- Select which type of function to create
- Name your function
Your text will be wrapped into a new Javascript function, depending on what you selected and called right afterwards. You can either automatically paste the new function right in the file, or copy it to clipboard and paste it wherever you like.
Installation
You can install JavascriptExtractFunction
via Package Control.
- Press cmd/ctrl + shift + p to open the command palette.
- Type
Install package
and press enter. Then search forJavascriptExtractFunction
Usage
To run the Javascript Extract Function command… open the Sublime Text Command Palette and type “Extract Javascript Function.”
You can also right-click on a selected piece of code in a file to bring up the Context Menu and select “Extract Javascript Function.”
Key Bindings
The plugin adds two key bindings that you can use as shortcuts.
- alt + m will ask you to select what type of function to extract your function into
- shift + alt + m will automatically extract an arrow function and paste it into your code
Limitations
This plugin does not currently support multiple selections. If you select more than one block, only the first one will be used in function creation.