AutoImport
Manage often-encountered keywords like "import", "use"
Details
Installs
- Total 14K
- Win 8K
- Mac 3K
- Linux 3K
Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 2 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 2 | 1 | 3 | 3 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
Linux | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Readme
- Source
- raw.githubusercontent.com
Sublime Keyword plugin
The glorious keywords manager. Created to manage often-encountered keywords like “import”, “use” and etc. By default support python “import” and php “use”.
Demo
Installation
This plugin is part of sublime-enhanced plugin set. You can install sublime-enhanced and this plugin will be installed automatically.
If you would like to install this package separately check “Installing packages separately” section of sublime-enhanced package.
Features
Create keyword from text (e.g. “from os import path” or “use yii\helpers\Url;”)
Display list of found keywords
Delete keyword using list of keywords
Create keyword using list of keywords
Update aliases from current project to reuse import definitions
This plugin is espesually worthy when using together with snippets (sublime-snippet-caller. E.g. “rs” expands to “re.search($0)” and creates “import re” in beginning of file in python.
Note that for now it works only with python and php. You should modify settings and .sublime-keymap files to add support for new languages.
Usage
Insert keyword
# before
re|.search() # <- cursor after "re"
# after insert keyword
import re
re|.search()
# before
<p><?= Ht|ml::encode($value) // <- cursor at Html ?>
# after
<?php
use yii\helpers\Html;
?>
<p><?= Html::encode($value) ?>
Insert keyword with snippet
# before
rs| # [tab]
# after
import re
re.search(|)
Snippet example
<snippet>
<content><![CDATA[
re.search($1, ${2:$indented_selection})
]]></content>
<tabTrigger>rs</tabTrigger>
<scope>source.python</scope>
<commands>
[
{
"command": "create_keyword",
"args": {"keyword_type": "python.import", "keyword": "re"},
},
"RUN",
]
</commands>
<description>re.search</description>
</snippet>
Settings
Settings is hash table; settings can be defined in KeymapEnhanced.sublime-settings file or in project settings (in this case “keyword” should precede settings key) each value contains hash table in following format:
“place”
Regexp that points to where to insert keywords.
“new_place_fallback”
Sublime command that executed if no “place” found.
“new_place”
Regexp that points where to insert keywords if no “place” found.
“definition”
Regexp that parses single definition from keywords list.
“delete”
How to delete keyword (allowed values: “token” or “statement”).
“cleanup”
Boolean; if true then “delete statement” will be executed after removing last keyword.
“snippets”
Snippets that will be used to create keywords from panel.
“search”
Regexp that shows how to search keyword.
“aliases”
List of aliases to quickly define keyword.
Commands
Description | Keyboard shortcut |
---|---|
Show keywords | ctrl+u, ctrl+i |
Update project keywords | ctrl+u, i |
Create keyword at cursor | ctrl+alt+e |
Delete keyword from list | ctrl+d |
Create keyword at list | ctrl+n |
Command paltte |
---|
Keyword: Show python imports |
Keyword: Show php uses |
Keyword: Update python imports |
Keyword: Update php uses |
Keyword: Create python import at cursor |
Keyword: Create php use at cursor |