All Projects → philippotto → Sublime Multieditutils

philippotto / Sublime Multieditutils

Licence: mit
A Sublime Text Plugin which adds various features for editing multiple selections.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublime Multieditutils

Material Theme
Material Theme, the most epic theme for Sublime Text 3 by Mattia Astorino
Stars: ✭ 11,093 (+5182.38%)
Mutual labels:  sublime-text
R Box
R package for Sublime Text 3
Stars: ✭ 177 (-15.71%)
Mutual labels:  sublime-text
Open In Editor
NPM package to open a file in editor
Stars: ✭ 187 (-10.95%)
Mutual labels:  sublime-text
Sublime Gulp
Run Gulp tasks and use snippets from Sublime Text
Stars: ✭ 155 (-26.19%)
Mutual labels:  sublime-text
Biosyntax
Syntax highlighting for computational biology
Stars: ✭ 164 (-21.9%)
Mutual labels:  sublime-text
Sublime debugger
Graphical Debugger for Sublime Text using the debug adapter protocol
Stars: ✭ 179 (-14.76%)
Mutual labels:  sublime-text
Comment Snippets
Sublime Text snippets to create fancy PHP, CSS and HTML comments.
Stars: ✭ 142 (-32.38%)
Mutual labels:  sublime-text
Sublimenotebook
📝 Make Sublime Text your favorite note taking/journal application
Stars: ✭ 203 (-3.33%)
Mutual labels:  sublime-text
Sendcode
Send code and text to macOS and Linux Terminals, iTerm, ConEmu, Cmder, Tmux, Terminus; R (RStudio), Julia, IPython.
Stars: ✭ 166 (-20.95%)
Mutual labels:  sublime-text
Zeal
Zeal for Sublime Text 2/3
Stars: ✭ 184 (-12.38%)
Mutual labels:  sublime-text
Neon Color Scheme
A colorful bright-on-black color scheme for Sublime Text and TextMate. Its aim is to make as many languages as possible look as good as possible. Includes extended support for Python, Ruby, Clojure, JavaScript/JSON, C/C++, diff, HTML/XML, Markdown, PHP, CSS/SCSS/SASS, GitGutter, Find In Files, PackageDev, Regex, SublimeLinter, and much more.
Stars: ✭ 159 (-24.29%)
Mutual labels:  sublime-text
Sublime Jekyll
A Sublime Text package for Jekyll static sites.
Stars: ✭ 160 (-23.81%)
Mutual labels:  sublime-text
Sublime Da Ui
Adaptive, Customizable, Elegant UI Theme and Color Schemes for Sublime Text 3
Stars: ✭ 180 (-14.29%)
Mutual labels:  sublime-text
Fuzzyfilepath
Autocomplete relative or absolute file paths in Sublime Text project folder
Stars: ✭ 153 (-27.14%)
Mutual labels:  sublime-text
Gruvbox
🎨 Sublime Text themes & color schemes with pastel 'retro groove' colors
Stars: ✭ 191 (-9.05%)
Mutual labels:  sublime-text
Editorconfig Sublime
Sublime Text plugin for EditorConfig - Helps developers maintain consistent coding styles between different editors
Stars: ✭ 1,749 (+732.86%)
Mutual labels:  sublime-text
Css3
The most complete CSS support for Sublime Text
Stars: ✭ 178 (-15.24%)
Mutual labels:  sublime-text
Vscode Sublime Keybindings
Sublime Text Keymap extension for VS Code
Stars: ✭ 208 (-0.95%)
Mutual labels:  sublime-text
Helium
Let Sublime Text 3 talk with Jupyter.
Stars: ✭ 192 (-8.57%)
Mutual labels:  sublime-text
Anaconda
Anaconda turns your Sublime Text 3 in a full featured Python development IDE including autocompletion, code linting, IDE features, autopep8 formating, McCabe complexity checker Vagrant and Docker support for Sublime Text 3 using Jedi, PyFlakes, pep8, MyPy, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3
Stars: ✭ 2,128 (+913.33%)
Mutual labels:  sublime-text

Sublime MultiEditUtils Build Status

A Sublime Text 2/3 Plugin which enhances editing of multiple selections. In case you aren't familar with Sublime's awesome multiple selection features, visit this page.

Features

Preserve case while editing selection contents

When multi-selecting all occurences of an identifier it is cumbersome to change it to another one if the case differs (camelCase, PascalCase, UPPER CASE and even cases with separators like snake_case, dash-case, dot.case etc.). The "Preserve case" feature facilitates this. Just invoke "Preserve case" via the command palette (or define an own keybinding) and type in the new identifier.

Split the selection

Sublime has a default command to split selections into lines, but sometimes you want to define your own splitting character(s). MultiEditUtils' split_selection command (default keybinding is ctrl/cmd+alt+,) will ask you for a separator and split the selection using your input. An empty separator will split the selection into its characters.

Extend the current selection with the last selection

Sometimes Sublime's standard features for creating multiple selections won't cut it. MultiEditUtils allows to select the desired parts individually and merge the selections with the add_last_selection command (default keybinding is ctrl/cmd+alt+u).

Normalize and toggle region ends

When creating selections in Sublime, it can occur that the end of the selection comes before the beginning. This happens when you make the selection "backwards". To resolve this, you can normalize the regions with MultiEditUtils' normalize_region_ends command (default keybinding is ctrl/cmd+alt+n). When executing this command a second time, all regions will be reversed.

This feature can also be very handy when you want to toggle the selection end of a single region.

Jump to last region

When exiting multi selection mode, Sublime will set the cursor to the first region of your previous selection. This can be annoying if the regions were scattered throughout the current buffer and you want to continue your work at the last region. To avoid this, just execute MultiEditUtils' jump_to_last_region command (default keybinding is shift+esc) and the cursor will jump to the last region.

Cycle through the regions

In case you want to double check your current selections, MultiEditUtils' cycle_through_regions command (default keybinding is ctrl/cmd+alt+c) will let you cycle through the active regions. This can come handy if the regions don't fit on one screen and you want to avoid scrolling through the whole file.

Strip selection

Sometimes selections contain surrounding whitespace which can get in the way of your editing. The strip_selection command strips the regions so that this whitespace gets removed. The default keybinding is ctrl/cmd+alt+s.

Remove empty regions

When splitting your selection or performing other actions on your selection, it can happen that some regions are empty while others are not. Often only the non-empty regions are of interest. The remove_empty_regions commands will take care of this and remove all empty regions from your current selection. The default keybinding is ctrl/cmd+alt+r.

Quick Find All for multiple selections

Similar to the built-in "Quick Find All" functionality, MultiEditUtils provides a functionality which selects all occurrences of all active selections. By default, it will select the word the cursor is on, if the selection is empty, just like find_all_under command. If you don't like this behaviour, add the argument "expand": false

These are just suggested keybindings, but you'll have to activate them in your keymap file first. Here shown for Windows/Linux:

ctrl+alt+f, ctrl+alt+f   case: true       word: true

ctrl+alt+f, c            case: true
ctrl+alt+f, ctrl+c       case: false
ctrl+alt+f, w            case: true       word: true
ctrl+alt+f, ctrl+w       case: false      word: true
ctrl+alt+f, q            case: true       word: true      ignore_comments: true

Additionally, you can perform a regex search that finds all occurrences of the entered regex. It can be additive (applied on top of your current selection) or subtractive (removes the results of the search instead). Example keybindings:

ctrl+alt+f, r                   
ctrl+alt+f, ctrl+alt+r          subtract: true                 
ctrl+alt+f, ctrl+r              case    : false                    
ctrl+alt+f, ctrl+alt+shift+r    subtract: true      case: false

Use selections as fields

Converts the selections to fields similar to the fields used in snippets. When the selection_fields command is executed, all current selections are saved as fields, which can be activated one by one. The first field is activated automatically. You can jump to the next field with tab (or the default keybinding) and to the previous field with shift+tab. If you jump behind the last field or press escape all fields will be converted to proper selections again. If you press shift+escape all fields will be removed and the current selection remains unchanged.

demo_selection_fields

You can bind this command to a keybinding by adding the following to your keymap (Change the key to the keybinding you prefer):

{ "keys": ["alt+d"], "command": "selection_fields" },

Although using one keybinding with the default options should be sufficient for most cases, additional modes and arguments are possible. Feel free to ignore or use them as you wish.

Arguments:

  • mode ("smart") is the executing mode, which defines the executed action. Possible modes are:
    • "push" to push the current selection as fields. This will overwrite already pushed fields.
    • "pop" to pop the pushed fields as selections
    • "remove" to remove the pushed fields without adding them to the selection. This has the same behavior as pop if only_other is true.
    • "add" to add the current selection to the pushed fields
    • "subtract" to subtract the current selection from the pushed fields
    • "smart" to try to detect whether to push, pop or jump to the next field
    • "toggle" to pop if fields are pushed, else push the selections as fields.
    • "cycle" to push or go next. This will cycle, i.e. go to the first if the last field is reached, never pops
  • jump_forward (true) can be true to jump forward and false to jump backward
  • only_other (false) ignores the current selection for pop and go next actions.

Suggestion for more keybindings based on the arguments:

// default use of selection_fields
{ "keys": ["alt+d"], "command": "selection_fields" },
// add the current selections as a fields
{ "keys": ["alt+a"], "command": "selection_fields", "args": {"mode": "add"} },
// jump and remove current selection in selection_fields
{ "keys": ["ctrl+alt+d"], "command": "selection_fields",
  "args": {"mode": "smart", "only_other": true} },
// cancel selection_fields and remove current selection
{ "keys": ["ctrl+alt+shift+d"], "command": "selection_fields",
  "args": {"mode": "toggle", "only_other": true} },

Installation

Either use Package Control and search for MultiEditUtils or clone this repository into Sublime Text "Packages" directory.

Shortcut Cheat Sheet

multieditutilscheatsheetmain

Thank you @AllanLRH for creating this cheat sheet!

License

MIT © Philipp Otto

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].