Text Utilities For Code Editors

Code Editor Utility Belt

Visual Studio Marketplace VersionGitHub Repo stars

EditorToIX are open-source text utilities available for multiple code editors in form of extension or plugins.

If you find this project useful, please, read the Support this Project on how to contribute.

Availability

IdOld NameCode Editor
vsxVscToIXVisual Studio Code
Cursor AI
Google Project IDX
open-vsx.org
vscode.dev
github.dev
linuxXedToIXLinux Mint Xed Editor
Pluma Code Editor
Gedit
phoenixBracketsToIXPhoenix Code

Available Languages

  • English
  • Portuguese
  • German

Utilities

GeneralSelection PolicyCode Editor
Extract TextDocumentvsx, phoenix
Header To BookmarkDocumentvsx, phoenix
MixerDocumentvsx, phoenix
RegnizeDocumentvsx, phoenix
Replace RecipesDocumentvsx
Reverse AssignmentDocumentvsx, phoenix
Change CaseSelection PolicyCode Editor
Add Space before UppercaseWordvsx, phoenix
Camel CaseWordvsx, phoenix
CapitalizeWordvsx, phoenix
Cycle CaseWordvsx, linux, phoenix
Dash CaseWordvsx, phoenix
Dash To UnderscoreWordvsx, phoenix
LowerCaseWordphoenix
Underscore To DashWordvsx, phoenix
UpperCaseWordphoenix
Encoders/DecodersSelection PolicyCode Editor
Html DecodeLinephoenix
Html EncodeLinephoenix
Url DecodeLinevsx, phoenix
Url EncodeLinevsx, phoenix
Change SlashSelection PolicyCode Editor
Double To Single SlashLinevsx, phoenix
Single To Double SlashLinevsx, phoenix
Unix To Win SlashLinevsx, phoenix
Win To Unix SlashLinevsx, phoenix
LineSelection PolicyCode Editor
Break Line AtDocumentvsx, phoenix
Indent One SpaceDocumentvsx, linux, phoenix
Join LinesDocumentvsx, phoenix
Outdent One SpaceDocumentvsx, linux, phoenix
Remove Duplicated LinesDocumentvsx, linux, phoenix
Remove Empty LinesDocumentvsx, linux, phoenix
Reverse LinesDocumentvsx, linux
Sort Numerically AscendingDocumentvsx, linux, phoenix
Sort Numerically DescendingDocumentvsx, linux, phoenix
Split LinesDocumentvsx, phoenix
Trim TrailingDocumentlinux, phoenix
InsertSelection PolicyCode Editor
Insert ISO DateDocumentvsx, phoenix
Insert ISO TimeDateDocumentvsx, phoenix
Insert UUIDDocumentvsx, phoenix
Insert Text At EndDocumentvsx, phoenix
Insert Text At StartDocumentvsx, phoenix
Change QuoteSelection PolicyCode Editor
Double To Single QuoteLinephoenix
Single To Double QuoteLinephoenix
Toggle QuoteLinephoenix
SpacingSelection PolicyCode Editor
Tab To SpaceDocumentphoenix
Space To TabDocumentphoenix

Project Status

This is a stable project with utilities being available on brackets code editor since 2016, however, since more editors have been supported, there is still work in progress to support the same extensions and policies across all code editors.Linux Mint Xed Editor has the smaller subset of extensions.

Demos - All Editors

  • IX: Cycle Case: Add a shortcut and cycle between different case modes in a breeze.

Cycle Case

  • IX: Indent One Space, IX: Outdent One Space: Insert or remove one space only at the start of every line regardless of indention mode.

Indent/Outdent

Demos - vsx and phoenix Editors

  • IX: Extract Text : Copy text patterns from a document to clipboard.

Extract Text

  • IX: Insert Text At Start: Insert text with macros at the start of every line.

Insert Text at Start

  • IX: Insert Text At End: Insert text with macros at the end of every line.

Insert Text at End

  • IX: Join Lines: Join text with macros.

Join Lines

  • IX: Break Line At: Splits each line in order to be no longer than Max number of Chars.The words aren't broken unless it's added / at the end the user input. (e.g. 40/).

Break Line At

Installation - Linux Mint Xed Editor, Pluma Code Editor and Gedit Code Editor

If you have previously installed xedtoix, you should uninstall first:

sudo apt uninstall xedtoix
sudo add-apt-repository ppa:a-bentofreire/editortoix
sudo apt-get update
sudo apt install editortoix

If you are updating from Linux Mint Software installer, you might have to activate the plugins on: Menu Edit -> Preferences -> Plugins

If you install Xed, Pluma or Gedit later, you can add or remove the plugins with:

sudo editortoix

Interface - phoenix Editor

EditorToIX adds a top-menu called IX.To prevent from cluttering the menu with all the commands, only a few commands were added to the menu.Use Command mapper to add which ones you prefer, and setup the shortcuts.No default shortcuts were define to prevent collision with other plugins.

Utility Description

UtilityDescriptionExample
Add Space before UppercaseUseful to transform functions names into documentationbefore: doActionBefore
after: do Action Before
Break Line AtBreak lines at a certain positionbefore:
Too long line
after:
too long
line
Camel Casebefore: ClassNameFunc
after: classNameFunc
Capitalizebefore: classNameFunc
after: ClassNameFunc
Cycle CaseLoops between differet case typesbefore: _ClassNameFunc
after: _classNameFunc -> _CLASS_NAME_FUNC -> _class_name_func -> _class-name-func -> _class name func ->_ClassNameFunc
Dash Casebefore: ClassNameFunc
after: class-name-func
Dash To Underscorebefore: find-deep-first
after: find_deep_first
Double To Single Slashbefore: find\\\nagain
after: find\nagain
Extract TextCopies to the clipboard the captured group of a regular expression.
Each capture is separated by tabs
(\w+) = (\w+)
Header To BookmarkConverts markdown header text to Html Bookmarkbefore: Is this the header 你好?
after: is-this-the-header-你好
Indent One SpaceAdds one space to the beginning of each line
Insert ISO Date2018-02-08
Insert ISO TimeDate2018-02-08 10:12:15
Insert Text At Endbefore:
red
green

after:
expr: = \c{1}
red = 1
green = 2
Insert Text At Startbefore:
red
green

after:
expr: const \e{upper} =
const RED = red
const GREEN = green
Insert UUID7fff60f8-91e8-40ba-9053-56b0f3a487f0
Join LinesJoins lines adding the computed expression at the end of every linebefore:
red
green

after:
expr:(x\c{X0A}),
red(x0A),green(x0B)
LowerCasebefore:classNameFunc
after:classnamefunc
MixerMixes lines of different sections.before:
// section
abc
cde
// end-section
// section
123
345
// section
after:
abc
123
cde
345
Outdent One SpaceRemoves one space to the beginning of each line
RegnizeAdds slash to regular expression metacharsbefore: (\w+)[A-Z]a*b+text
after: \(\\w\+\)\[A-Z\]a\*b\+text
Remove Duplicated LinesRemoves consecutive duplicated linesbefore:
first
second
second

after:

first
second
Remove Empty LinesRemoves empty linesbefore:
first

second

after:

first
second
Replace RecipesReplaces text from a list of pre-defined recipes
Reverse AssignmentReverses the terms of assignments or equal/different comparisonsbefore: x == y[x] + 5
after: y[x] + 5 == x
Reverse LinesReverse linesbefore:
first
second
third
after:
third
second
first
Single To Double Slashbefore: find\nagain
after: find\\\nagain
Sort Numerically AscendingFor each line uses the first number as sort keybefore:
10. red
2. green

after:

2. green
10. red
Sort Numerically DescendingFor each line uses the first number as sort keybefore:
10. red
`2.
Space To TabSpace to Tab only works with leading spaces
Split LinesSplit lines by an expression. Dynamic values aren't supportedbefore:
red,green

after:
expr: = \c{1}
red = 1
green = 2
Tab To SpaceSpace to Tab only works with leading spaces
Trim TrailingRemoves trailing spaces of each line
Underscore To Dashbefore: find_deep_first
after: find-deep-first
Unix To Win SlashConverts slashes to backslashesbefore: chocolate/candy
after: chocolate\candy
UpperCasebefore:classNameFunc
after:CLASSNAMEFUNC
Url Decodebefore: https%3A%2F%2Fgithub.com
after: https://github.com
Url Encodebefore: https://github.com
after: https%3A%2F%2Fgithub.com
Win To Unix SlashConverts backslashes to slashesbefore: chocolate\candy
after: chocolate/candy
Double To Single Quotebefore:find"again
after:find'again
Html Decodebefore:<h1>Title</h1&gt
after:<h1>Title</h1>
Html Encodebefore:<h1>Title</h1>
after:&lt;h1&gt;Title&lt;/h1&gt
Single To Double Quotebefore:find'again
after:find"again
Toggle Quotebefore:find"again'
after:find'again"

Selection Policies

vsx Editors

Every utility supports multiple cursors and multiple line selections.However, It differs in the way each utility category handles the selections.For every cursor, each line is process individually and the counter is increased per line.

  • Line Utilities:
    • If no text is selected then all the document text is used.
    • If part of the line is selected then all the line is used
  • Transform Text Utilities:
    • If no text is selected then all the document text is used.
  • Insert Text Utilities:
    • If no text is selected then the cursor is the insertion point.
    • If multiple lines are selected then is inserted at start/end of every line.

Phoenix Code

Most of the commands operate on selected text.If no text is selected, a command will use:word - The nearest word (before and after the cursor)sentence - The nearest text until a whitespace or newlineline - The text line where the cursor is located.document - All the editor textfunction - A function determines the text to use. Ex: Quote functions will use all the text between quotes that surrounds the cursor.

Linux Mint Xed Editor

  • Document Plugins:
    • If no text is selected then all the document text is used.
    • If part of the line is selected then all the line is used
  • Word plugins:
    • If no text is selected then word surrounding cursor is used.

Expressions - vsx

Some of the utilities support expressionsAn expression is a text supporting the following metachars:

  • \n - newline

  • \t - tab

  • \c{start-value} - counter with optional start value

    • \c 0,1,2,...
    • \c{10} 10,11,12,...
    • \c{x00a} x00a,x00b,x00c,...
    • \c{XF} xF,x10,x11,...
  • \e{func} - transforms the selected text (line by line)  function list:

    • upper - UpperCase
    • lower - LowerCase
    • length - Selected text length
    • capitalize
    • isodate
    • isotimedate
    • uuid

Replace Recipes - vsx

Replace Recipes must be added manually to the settings.json.This tool is still in beta phase.

FieldTypeDescription
namestringRecipe name
patternstringFind Expression (RegExp or String)
replaceWithstringReplace Text
isRegExpbooleanif false then pattern is a static string
isExpressionbooleanif false then result doesn't exec the expression engine
ignoreCasebooleanif true and isRegExp uses ignore case option

ex:

"vsctoix.replaceRecipes": [
    {
      "name": "repl with let",
      "pattern": "\\b(var|const)\\b",
      "replaceWith": "let"
    },
    {
      "name": "Remove starting dash",
      "pattern": "^\\s*-",
      "replaceWith": ""
    },
  ],

Support this Project

If you find this project useful, consider supporting it:

  • Donate:

Donate via PayPal

Buy me a Coffee

License

MIT License - vsx and phoenix Editors

GPLv2 License - Linux Code Editors

Copyrights

© 2014-2024 Alexandre Bento Freire