Script-provided Add-on Commands
Django Script
A plugin that provides Django-specific functionality when a project looks like it contains Django files.
django-collect-static ()
Run' manage.py collectstatic --noinput' in the OS Commands tool.
django-migrate-app (appname)
Run manage.py makemigrations for given app name and display the output in a scratch buffer.
django-migrate-db ()
Run manage.py migrate (or syncdb in Django 1.7 and earlier)
django-restart-shell ()
Show and restart the Python Shell tool, which works in the same environment as "manage.py shell". To show the tool without restarting it, use the Tools menu.
django-run-tests ()
Run manage.py unit tests in the Testing tool
django-run-tests-to-scratch-buffer ()
Run manage.py tests with output in a scratch buffer
django-show-docs ()
Show documentation for using Wing and Django together
django-show-migrations ()
Run manage.py showmigrations and display the output in a scratch buffer.
django-start-app (appname)
Start a new application within the current Django project and add it to the INSTALLED_APPS list in the project's settings.py file.
django-validate ()
Run manage.py check (or validate in Django 1.5 and earlier)
Django Script
A plugin that provides Django-specific functionality when a project looks like it contains Django files.
Emacs Extensions Script
This file contains scripts that add emacs-like functionality not found in Wing's internal emacs support layer.
add-change-log-entry (user_name=None, email=None, changelog=None, changed_file=None, func=None, other_window=False, new_entry=False)
Add a change log entry Key Bindings: Emacs: Ctrl-X 4 A
Editor Extensions Script
Editor extensions that also serve as examples for scripting Wing.
batch-search-current-directory ()
Initial batch search for the current editor's directory
cc-checkout ()
Check the current file out of clearcase. This is best used with Wing configured to auto-reload unchanged files.
close-all-readonly ()
Close all readonly files
comment-block-toggle ()
Toggle block comment (with ## at start) on the selected lines in editor. This is a different style of block commenting than Wing implements by default (the default in Wing is intended to work better with some of the other editor functionality) Key Bindings: Eclipse: Ctrl-/; MATLAB: Ctrl-T
convert-to-cr-lineends ()
Convert the current editor to use CR style line endings
convert-to-crlf-lineends ()
Convert the current editor to use CR + LF style line endings
convert-to-lf-lineends ()
Convert the current editor to use LF style line endings
copy-filename-to-clipboard ()
Copy the filename for the currently selected file to the clipboard
copy-reference (include_text=True)
Copy 'filename, lineno (scope)' optionally followed by the current line or selected lines to the clipboard. The scope is omitted if there isn't one or in a non-Python file.
cursor-end ()
Bring cursor to end of line, to end of visible area, or to end of document each successive consecutive invocation of this command. Key Bindings: Brief: End
cursor-home ()
Bring cursor to start of line, to start of visible area, or to start of document each successive consecutive invocation of this command. Key Bindings: Brief: Home
delete-selected-lines ()
Delete the line or range of lines that contain the current selection. This duplicates what the editor command delete-line does. Key Bindings: Brief: Alt-D
describe-key-briefly (key)
Display the commands that a key is bound to in the status area. Does not fully work for the vi binding.
end-of-block ()
Not documented
fold-python-classes ()
Fold up all Python classes but leave other fold points alone Key Bindings: Wing: Alt-2; Brief: Alt-2; Eclipse: Alt-2; Emacs: Alt-2; macOS: Command-Ctrl-/; MATLAB: Alt-2; VI/VIM: Alt-2; Visual Studio: Alt-2; XCode: Command-Ctrl-/
fold-python-classes-and-defs ()
Fold up all Python classes, methods, and functions but leave other fold points alone Key Bindings: Wing: Alt-3; Brief: Alt-3; Eclipse: Alt-3; Emacs: Alt-3; macOS: Command-=; MATLAB: Alt-3; VI/VIM: Alt-3; Visual Studio: Alt-3; XCode: Command-=
fold-python-methods ()
Fold up all Python methods, expand all classes, and leave other fold points alone Key Bindings: Wing: Alt-1; Brief: Alt-1; Eclipse: Alt-1; Emacs: Alt-1; macOS: Command-Alt--; MATLAB: Alt-1; VI/VIM: Alt-1; Visual Studio: Alt-1; XCode: Command-Alt--
hyphen-to-under ()
Change hyphens (dashes) to underscores in current selection or current word
indent-new-comment-line ()
Enter a newline, indent to match previous line and insert a comment character and a space. Assumes that auto-indent is enabled.
insert-debug-print ()
Insert a print statement to print a selected variable name and value, along with the file and line number.
insert-spaces-to-tab-stop (tab_size=0)
Insert spaces to reach the next tab stop (units of given tab size or editor's tab size if none is given)
insert-text (text)
Insert given text at current caret location, replacing any existing selected text
kill-line-with-eol ()
Variant of emacs style kill-line command that always kills the eol characters
lower-case ()
Change current selection or current word to all lower case Key Bindings: Eclipse: Ctrl-Shift-X; MATLAB: Ctrl-U
open-clicked-filename-from-editor ()
Open the filename being clicked in the current editor
open-clicked-url-from-editor ()
Open the url being clicked in the current editor
open-filename-from-editor ()
Open the filename at the caret in current editor Key Bindings: MATLAB: Ctrl-D
open-url-from-editor ()
Open the url at caret in the current editor
remove-prompts-and-paste ()
Paste from clipboard after removing any >>> and ... prompts
search-python-docs ()
Do a search on the Python documentation for the selected text in the current editor
set-executable-bit (set_bit=True)
Set the current file's executable bit in its permissions. If set_bit is true (the default), the executable bit is set; if set_bit is false, the executable bit is cleared. This doesn't do anything on windows.
smart-copy ()
Implement a variant of clipboard copy that copies the whole current line if there is no selection on the editor.
smart-cut ()
Implement a variant of clipboard cut that cuts the whole current line if there is no selection on the editor.
smart-paste ()
A variant of paste that inserts line just copied with smart-copy above current line.
sort-selected ()
Sort selected lines of text alphabetically
start-of-block ()
Not documented
surround (char)
Surround selected text with (), [], {}, "", '', <>, or ``. Arg char should be the opening character. If there is no selection, the current word is surrounded.
title-case ()
Change current selection or current word to capitalize first letter of each word Key Bindings: Emacs: Alt-C
toggle-case ()
Toggle current selection or current word between common name formats: my_symbol_name, MySymbolName, and mySymbolName
toggle-mark-command (style='char', select_right=0)
Change between text-marking and non-text-marking mode. Style is "char" for stream select, "block" for rectangular select, and "line" for line select. Set select_right=1 to select the character to right of the cursor when marking is toggled on. Key Bindings: Brief: Alt-L invokes toggle-mark-command(style="line")
toggle-toolbox-separate ()
Toggle between moving the toolboxes to a separate window and the default single-window mode
toggle-vertical-split ()
If editor is split, unsplit it and show the vertical tools panel. Otherwise, hide the vertical tools and split the editor left-right Assumes default windowing policy (combined toolbox & editor windows). Thanks to Jonathan March for this script.
under-to-hyphen ()
Change underscores to hyphens (dashes) in current selection or current word
upper-case ()
Change current selection or current word to all upper case Key Bindings: Eclipse: Ctrl-Shift-Y; MATLAB: Shift-Ctrl-U
vi-fold-less ()
Approximation of zm key binding in vim Key Bindings: VI/VIM: z m
vi-fold-more ()
Approximation of zr key binding in vim Key Bindings: VI/VIM: z r
vs-tab ()
Modified tab indentation command that acts like tab in Visual Studio.
watch-selection ()
Add a debug watch for the selected text in the current editor
word-list-completion (word)
Provide simple word-list driven auto-completion on the current editor
Testapi Script
Tests for Wing's scripting API.
test-api (verbose=0)
Test Wing's scripting API
Debugger Extensions Script
Scripts that extend the debugger in various ways.
debug-run-to-completion ()
Run the current debug process to completion. This disables all breakpoints temporarily until the process exits.
set-breaks-from-markers ()
Scan current file for markers in the form %BP% and places breakpoints on all lines where those markers are found. A conditional breakpoint can be set if a condition follows the marker, for example %BP%:x > 10. Removes all old breakpoints first.