You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
TextTools provides a small collection of macros for text manipulation. They are intended to be used together with EditorMacro http://www.mathworks.com/matlabcentral/fileexchange/24615.
Included macros are:
transpose_chars
Swap characters around the caret
transpose_words
Swap words around the caret
capitalize
Capitalize word starting from caret location
fill_comment
Wrap current comment paragraph. Selects current comment paragraph and wraps and indents it.
Follows Editor's comment width preference.
Syntax:
tt = TextTools;
ttMacro = TextTools(MacroName)
Examples:
tt = TextTools;
EditorMacro('Alt-Q',tt.fill_comment,'run')
EditorMacro('Shift-Ctrl-T',TextTools('transpose_words'),'run')
Warning:
This code heavily relies on undocumented and unsupported Matlab functionality. Use at your own risk!
Cite As
Perttu Ranta-aho (2026). TextTools (https://www.mathworks.com/matlabcentral/fileexchange/25122-texttools), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired by: EditorMacro - assign a macro to a keyboard key-stroke in the Matlab Editor and Command Window
General Information
- Version 1.0.0.0 (3.25 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
