I use PhpStorm for years and have a habbit to select some word to find all its occurences in file.
Before phpstorm 10 when I select some word and press Ctrl+F, it just highlighted the word, cursor stayed on the word (and its occurences) and it showed search panel at the top of editor with matches count.
After upgrade to phpstorm 10 it became work in other way. Now when I select some word and press Ctrl+F it immediately jumps to next occerence of the selected word (it may be e.g. on the other end of the file).
That's very annoying - have to hit Back to move to the place where I started searching.
Does anybody know the reason of it? Maybe there is a way to disable such new behaviour?
Related
How can I select several lines in Intellij using keyboard shortcuts?
I found out that I can do it with
ctrl + shift + right/left
But I have to press this buttons several times to select whole line.
What is more the selection starts from current caret position, so if it's not the beginning/end (depending of using left or right arrow) of the line, the whole first line is not selected.
What I usually do is to hit the Home key, and then either:
Shift+End to select until the end of the current line, or
Shift+Down to select until the next line, and then keep pressing Shift+Down to select multiple lines.
Also, IntelliJ IDEA supports the "Extend Selection" and "Shrink Selection" commands, for which the default key bindings are Ctrl+Alt+Left and Ctrl+Alt+Right.
These allow you to select entire blocks of code rather than word by word. You may still need to press the keys multiple times, but way fewer times than when selecting on a word by word basis.
Short Version
In MS Word, is there a way to insert some text and remove some(simultaneously) at the point of blinking cursor or wherever a user clicks repeatedly.
This (Insertion/Deletion) can be achieved in the following ways:
Mouse click
(Ctrl, Alt or Shift) + Mouse click
Ctrl/Alt/Shift+Mouse click + (Any Key)
Long Version
I have text copied from various sources in different word files which I want to format in a particular style so as to match a given layout. Basically the text needs to be broken down into new lines/paragraphs at specific places which is given in the instructions. Instead of having to press 'Enter' and then remove/delete spaces at every line, I wish to do that with just one click per line using macro.
These files could be 500+ in number, so modifying all in one go using Macros is the preferred way.(Although I find it impossible when the point of insertion of 'Enter' can only be done manually on each file.) I have used Macros to achieve 90% of that however need one last step where a Macro can do the following:
Where ever the user clicks on the page, all space(regular, non-breaking space, white-space) until the next printed character is deleted.
An 'Enter' or Carriage-Return is inserted, so that the text moves to the next line.
Steps 1 and 2 are repeated at every click the user makes on the text.
Example Text
This is an example, of my text, which I need to split up, into different lines.
Expected Text
This is an example, of my text,
which I need to split up,
into different lines.
Notice that as 'Enter' is pressed at the end of these lines although they come in next line but usually a space character is there in front of those lines. Another approach is to click, delete the required spaces until the next character and then hit enter. I want either of these to be done automatically with just a mouse click or a minimum of key+mouse combo.
Something like Find ^w and Replace with ^p running at every place a user clicks, but with Macros.
Any help is appreciated.
This would be possible by defining a shortcut to your macro. So you would need to click at a position and use your shortcut to run the macro.
Eg. Add this to a module in your document
Option Explicit
Public Sub DeleteSpacesAndInsertEnter()
Application.ScreenUpdating = False
Selection.SetRange Selection.Start, Selection.Start + 1
If Asc(Selection.Text) = 32 Or Asc(Selection.Text) = 160 Then
Do While Asc(Selection.Text) = 32 Or Asc(Selection.Text) = 160
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.SetRange Selection.Start, Selection.Start + 1
Loop
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeParagraph
End If
Application.ScreenUpdating = True
End Sub
and assign a shortcut to it.
It deletes all spaces & non breaking spaces right from the current cursor position and then inserts an enter.
Earlier, I thought of using Find and Replace at the place of cursor, Finding ^w and Replacing with ^p but this required me to Constantly lift the shortcut keys I assigned with my macro, otherwise it would just break the complete text at every word into paragraphs. Just pressing Ctrl and click would highlight the text between cursor and mouse click. All in all, I had to press (Ctrl+D), move the cursor to the new point using Click, AGAIN press Ctrl+D. Thus lifting 3 fingers for every change, making it impractical.
Pᴇʜ Macro helped
Ctrl+D+Click still doesn't work seamlessly. Works in 3 steps repeating.
Alt+D+Click worked almost flawlessly, with just one step repeating.
Applying this macro, even if I keep Alt+D(my shortcut) pressed all the time, simply clicking at the desired place does my job. Although Alt + Click anywhere in Word 2007 brings up a Research Window which updates as the text is clicked but in no way interferes with the job being done.
Thanks a lot everyone and especially P for all your help, really appreciate it.
Cheers
Is there any way to select the whole line at caret in IntelliJ 15? I know you can select the current word (ctl + w), go to beginning/end of line but I can't find a current line selection feature.
Simply hit
ctrl+c
Note that for this to select the whole line, you need to ensure that nothing is already selected; otherwise it'll work as an usual "copy" command.
move caret to line
on Windows, press ctrl+shift+a .
This popup appears, where you find Select Line at Caret
for quick access, you can specify a shortcut in Settings
I would like to also add the following from JetBrains website. Because, that what i was looking for here, but no one mentioned it.
1- To select text from the current caret position to the beginning/end of
the current word:
Ctrl+Shift+Left, Ctrl+Shift+Right.
2- To select text from the caret
position to the beginning/end of the current line:
Double-click Ctrl and press Home/End
3- To select text from the current
caret position to the top/bottom of the screen:
Ctrl+Shift+Page Up, Ctrl+Shift+Page Down.
If none of the above are working, I suggest using end and home keys in combination with shift allowing you to select lines quickly.
Go to the end of the line and hit Ctrl+W. If you'll hit Ctrl+W at the beginning of the line it will select only one word.
Not a keyboard feature, but nice to use:
to select the whole row just click on row number on the left of the code.
In addition to that you can click and drag selection.
Moreover, you can doubleclick on the number of the first line of method which results selection of the whole method.
In IDEA, when I have some text selected (e.g., a symbol), is there a way to quickly jump to the next occurrence of my current selection in the current file? I can do Ctrl+F, F3 and Esc but isn't there a quicker way, without the need to go through the find panel?
Edit: to make it clear, I am looking for a way to do this without the Find panel being open.
(One thing I noticed: the area behind scrollbar automatically indicates where else the current selection appears in the current file. Maybe there is some command to go to the next occurrence as indicated by the gutter?)
Select desired text and press CTRL+F3 to search for current selection, and then F3 for next ocurrence (or keep pressing CTRL+F3)
Try BrowseWordAtCaret, it is much better than CTRL+F3 which others suggested.
Description:
Allows to easily browse next/previous word at caret and highlight other appearances of selected word.
Usage: Browse with CTRL-ALT-UP, CTRL-ALT-DOWN (note: on default-keymap this shortcut is also for next/previous occurrence).
Once you have your search dialog open, use F3 to move to the next occurrence. Use Shift+F3 to move back an occurrence.
In IntelliJ 10.5 I have "Highlight usages of element at caret" enabled. When a variable/method/etc is selected, is there a way to move to the next and previous occurrence? I'm looking for the equivalent of Control-K in Eclipse.
Edit: Shortcut to navigate between highlighted usages simply moves to the next text occurrence, which is different than moving to the next occurrence of the variable/method/etc. If I have the variable foo selected, I want to navigate to the next occurrence of foo and not any piece of text called "foo" (including "foo" in comments, method names, etc).
Also, pressing F3 seems to be buggy. When I press F3, it sometimes searches using the previous searched text and not the currently highlighted text.
F3 or shift+F3
ctrl+c, ctrl+f, enter or up and down arrows
ctrl+alt+F7
Added this in case people don't look at your edit.
It's not currently possible, see my question: Shortcut to navigate between highlighted usages.
I even created an issue IDEA-70523 addressing this feature, please vote for it if you can't live without it like me :-).
Install Identifier Highlighter Reloaded and use Alt + Shift + Up/Down (can be redefined in Keymap settings) :)
After you give it a shot and notice the 'hey, the highlight stays there after I move my cursor out of it' annoyance, consider upvoting this issue :)
In the Mac OS, you can navigate to next highlighted usage by press control + option + up/down arrow.
Vote this request up for make them implement the feature.
http://youtrack.jetbrains.com/issue/IDEA-59638
I found something thay may more suite your needs : alt + mouse-wheel up/down.
It goes to previous / next occurrence of identifier under caret.
Shortcut name is "Go to next highlighted element usage".
I usually do the following:
Highlight the word
Cmd + F (it will highlight all the matches in file)
Cmd + G (next match)
Cmd + Shift + G (previous match)
I could not get any of IntelliJ's native options for Find Next/Previous to behave like in Eclipse. Find Word at Caret comes close, but it only allows you to slurp and find the next word, not previous.
Identifier Highlighter Reloaded also does not behave like Eclipse.
I wrote an IntelliJ plugin to reproduce the exact behavior as in Eclipse. You can find it here: https://plugins.jetbrains.com/plugin/10635-quick-find-plugin
Look for next occurrence # Keymap
^G = "select" the variable that you want to search for
[shift]⌘G = [previous]next occurrence of selected variable
All credits to #Igor Wojda for his comment in the accepted answer.
(AFAIK, limiting search scope to only variable/method is not possible)
For text based match and quick jump:
Simply place the cursor over the desired word to be searched
Press Ctrl+F3
For further down/up search, simply use
F3/Shift+F3 respectively
in Intellij shortcut for this action, it's not defined.
but you can define it like this:
Ctrl+ Alt + S
search " highlighted usage"
then you can set a shortcut for that.
Ctrl+Alt+Up and Ctrl+Alt+Down navigates to the next and previous usages of a highlighted variable in IntelliJ.
I use this functionality of navigating to the next usage of a variable in a file by hot in Visual Studio all the time (Ctrl+Shift+Up and Ctrl+Shift+Down) and was looking for the equivalent in IntelliJ