Sublime text 2 tab through multiple selection - sublimetext2

Lets say that I have selected the word 'test' three times using ctr + d.
Is there a way to tab through the selections. So for example if I wanted to go to the second word and only change that one.
I seem to need this quite often but I cannot find it anywhere.
And I also know about the skipping with ctr + d and ctr + k but this is not what I mean.

The MultiEditUtils package supports this.
Just install the package and bind a key to the selection_fields command, e.g.
{ "keys": ["alt+d"], "command": "selection_fields" },
To use it just create your multiple selection and press the keybinding. Then you can use tab and shift+tab to tab through the selection. If you tab behind the last one or press escape, then the multiple selection will be restored.
Demo:

It sounds like what you want is search. Sublime's search is accessed via Control+F (Windows/Linux), or Command+F (Mac). Sublime's search behaves similarly to many other applications, often web browsers have this feature. You can use this to cycle through instances until you find the one you were looking for. If you then hit enter, search will exit and the cursor will stop at the currently selected instance of your word.
See Sublime's unofficial docs for more details about its full search capabilities.

Hit Control+F to bring up the search
Type the term you want to replace
Put your cursor at the beginning of your document
Hit Control+G to select one
instance after the other and change it

Related

How to wrap text for mysql database results in PhpStorm

I'm wondering if there is a way to wrap text in the database tab in PhpStorm.
There are some very long results that goes further than I'm able to see.
Here is how that looks like:
Are there any kind of settings or preferences that can wrap text for mysql results in PhpStorm?
I'm using PhpStorm version 2019.1.1
EDIT
I found something that might solve this issue: https://www.jetbrains.com/help/phpstorm/database-tool-window.html (CTRL + F wrap), but I simply cannot find the icon for "Foreign Data Wrapper"
Foreign data wrappers are a concept in Postgres for remote object access. You're looking at the wrong docs, the database tool window is the one where you can create/configure datasources, the window that shows the data is the database console's result pane.
Anyways, AFAICT there is no way (yet) to show the columns wrapped by default. Only when for the edit mode you can activate soft wrapping. Double click on the column or hit F2, then use View > Active Editor > Soft Wrap.
In File > Settings > Keymap you can put that on a shortcut for easier access.
If you enable soft-wrapping for all "files" by specifying * in File > Settings > Editor > General > Soft-wrap files, then the table editor's edit mode is affected by it too and will wrap in edit mode by default.
See also
https://youtrack.jetbrains.com/issue/DBE-5534
https://youtrack.jetbrains.com/issue/DBE-1951
https://www.jetbrains.com/help/phpstorm/2019.1/settings-keymap.html
https://www.jetbrains.com/help/phpstorm/2019.1/database-console.html#f90b0d14
https://www.jetbrains.com/help/phpstorm/2019.1/table-editor.html
https://www.jetbrains.com/help/phpstorm/2019.1/settings-editor-general.html

How to set default scope to Directory in 'Find in Path' dialog

I'm pretty sure that on other computer when I've used 'Find in Path' or pressed Ctrl+Shift+F when I've previously selected directory, radio button 'Directory' in 'Scope' was checked by default. Now I must press Ctrl+Shift+F and press Alt+O additionally for searching in selected directory. Maybe that's some bug?
How to set my Find in Path dialog so it will be saving last search options? I see that it's saving options listed in 'Options' area in 'Find in Path' dialog. Scope is changing to 'Whole project' all the time.
I can't find that option in PhpStorm. I can't find similar problems/explanation of problem in google.
Maybe that's some bug?
No bug here -- works as designed.
I can't find that option in PHPStorm, I can't find similar problems/explanation of problem in google.
There is no such (global) setting.
Some of the options on that dialog window will be set accordingly to the context (where it was invoked from):
if invoked from Editor (focus was in Editor when you pressed Ctrl + Shift + F) then it will be "Whole Project". In most cases that's exactly what will be needed.
if invoked while having focus in Project View panel .. then it will select that particular directory as default scope/path.
You can follow this ticket for any progress on this matter: https://youtrack.jetbrains.com/issue/IDEA-87037
I realized, that if there is index update running, that's behaving in such way. When indexing is finished, everything works as I'm expecting (so, PHPStorm is searching in selected directory). I think it looks weird.

Sublime text volatile find next

I am trying to replicate Eclipse volatile find next functionality (I think that is what it is called).
This is where the search term for find next will automatically be set to whatever text is highlight.
In sublime text, when I hit find next, if will jump to the next occurrence of the last term searched for. If I selected over a different term, it still will search for the last term entered when I pressed ctrl+F.
In eclipse it will always set the current search term to the current highlight text at the time find next is hit. I am a pretty big fan of this functionality.
To do something similar in sublime, I have to select the text then hit ctrl+F, esc, then find next.
Is there a way to set the search at to the current highlighted text at when find next is hit?
Similar functionality exists as "Quick Find" in Sublime Text 3 (Ctrl+F3 shortcut on Windows). It is possible to create a sublime-keymap file to remap the "Find Next" binding (F3) to this if you desire, see the documentation here: http://docs.sublimetext.info/en/latest/customization/key_bindings.html. Looking at the default mapping, the sublime text "command" for this is called find_under.
EDIT: Sublime Text has a "Use Selection for Find" feature (Ctrl+E, command slurp_find_string), which affects "Find Next" (F3) and "Find Previous" (Shift+F3). Unfortunately, Sublime Text does not allow binding one key to multiple commands, which means that it is not possible to rebind F3 to execute the slurp_find_string command when the selection is not empty, and then perform a find_next as normal. It may be possible by creating a plugin, however. Someone has already done something similar here which may be helpful as a starting point: https://www.sublimetext.com/forum/viewtopic.php?f=5&t=8677

How to edit multiple files through "Find results" in Sublime Text

When I search multiple files via Command + Shift + F, the result is returned as something like a text file. This text file is editable, but changes made don't affect the original files.
Is it possible to do such that changes in "Find Results" propagates to the original source file?
The Find Results Apply Changes plugin was created to do just that.
You can install it through Package Control's "Install Package" option.
Before using this plugin, make sure that you have UTF-8 encoding enabled using the menu:
File > Save with Encoding > UTF-8
Once installed, you can apply any change you made to a "Find Results" buffer back to the files:
Search for "foo" in a folder (Sublime's default shortcut is CTRL+SHIFT+S)
This will open a "Find Results" buffer listing all the files with "foo" in it.
Change the instances of "foo" for "bar" or something else...
Go to the menu:
Find > Find Results - Apply Changes
This will write all the changes made back to the files and save the modified files automatically.
By default, using menus is the only way to make it work. However, it is quite tiresome and doesn't save as much time as it does with a keyboard shortcut. You can set your chosen keyboard shortcut by adding a new line in
Preferences > Key Bindings - User
by adding:
{ "keys": ["ctrl+r"], "command": "find_results_apply_changes" },
Don't use CTRL+S as it will overwrite saving file shortcut.
Warning!: According to the author of the plugin:
Uses regions to allow you do multiline changes, but when inserting new
newlines, will corrupt files if you commit more than once, this
because the new newlines will shift the line numbers. Will also
'corrupt' files if you add/remove newlines in other instances of the
modified files. eg in another tab. To prevent corruption this packages
will alert you and prevent most of these.
(This is a modified version of the description from the Find Results Apply Changes Github page.)
The shortest workaround I can think of would be to open the target file from search results by simply double clicking the path and then jumping to the according line using Ctrl+G on Windows or ⌃+G on Mac OS.
That's the way I do it and must say it is only a matter of seconds, even without the plugin.

pressing ctrl+w in mysql workbench results in ETB

So I'm using the MySQL Workbench SQL Editor 5.2.45 CE
However whenever I try to close a tab using the keyboard shortcut Ctrl+W, instead of closing the tab it prints out "ETB" in the query editor instead and does not close the tab...
Any idea what's causing this and how to resolve it?
You are probably working on Windows. The ETB output is from the editor when the hotkey is not handled in the UI and hits the editors input processor without being defined for an action (like select word or copy to clipboard). The editor control is a Scintilla instance which is able to also display non-printable characters.
The hotkey Ctrl+W was previously used to close tabs, but since Ctrl+F4 is much more common on Windows it was changed. So use Ctrl+F4 in the future instead.