Easy toggling to next parameter in IntelliJ - intellij-idea

Let's say you are in a method with two parameters and you filled the first one:
foo("test",
so the caret is right after second "t" letter. It's possible to hit Tab and caret moves just after the comma in Eclipse. Is there such a feature in Intellij IDEA?

See the related question: IntelliJ equivalent to Eclipse TAB and vote for this feature in YouTrack.

Related

How can I enter a literal <TAB> character in IntelliJ/IDEA/PyCharm?

My configuration indents with four spaces, and I want to keep that. Occasionally (e.g. in a Makefile) I want to input a literal TAB character.
How can I force the IntelliJ-IDEs to input a tab or space, when it would not do so when I hit tab or space in that instance?
You seem to be asking two questions here:
1. How do I force IntelliJ IDE to input a tab, when it would not do so when I hit tab?
and
2. How do I force IntelliJ IDE to input a space, when it would not do so when I hit space?
I don't understand how the second case can arise. However, I have provided a solution to it as well.
Case 1. Insert a tab character when an IntelliJ IDE wants to replace it with spaces due to configuration
Solution
Use search and replace.
Details
Place the cursor where you want the tab to be
Press the X key
Select the X you just typed
From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
Make sure there is an X in the search field
Enter \t in the replace field
Be sure the option Regex is checked
Be sure the option In Selection is checked
Click the Replace button
Case 2. Insert a space character when an IntelliJ IDE won't just let you type one (???)
Solution
Use search and replace.
Details
Place the cursor where you want the space to be
Press the X key
Select the X you just typed
From the main menu, choose Edit | Find | Replace to bring up the search and replace pane
Make sure there is an X in the search field
Enter a single space into the replace field
Be sure the option In Selection is checked
Click the Replace button
Install the plugin for Makefile support: https://plugins.jetbrains.com/plugin/9333-makefile-support
When I tried it today, this automatically use hard tabs in the editors for Makefile files.
Open another text editor, type a tab, and then copy and paste into the PyCharm editor. In MacOSX this worked for me using both Sublime Text 2 and TextEdit.
I can't think of any "direct" way. Probably the easiest way that I can think of is to write a Live Template to do it. See the help page on Live Templates for more information. When you write it, you may need to copy and paste a tab character in from another application.
However, when I tried it, IDEA saw it as just empty text and would not save it. So I used a variable with the "capitalize" function to capitalize a tab character.
Here's the template I created that you can paste into your templates. Now I type tab, hit the Tab key and I get a tab character. Of course you can change the abbreviation.
<template name="tab" value="$TAB$" description="Enter a tab Character" toReformat="false" toShortenFQNames="true">
<variable name="TAB" expression="capitalize(" ")" defaultValue=" " alwaysStopAt="false" />
<context>
<option name="OTHER" value="true" />
</context>
</template>
You could extend the idea to have multiple ones that enter multiple tabs. For example tab to enter 1 tab, tab2 for 2 tabs, etc.
Screenshot of it after use:
There may also be a way to hack a macro to do it. You could then assign the macro to a keyboard shortcut. I'll see if I can figure something out and update this if I do.
Use the menu option: Edit -> Convert Indents -> To Tabs.
Whenever I edit a makefile I do the "to tabs" conversion before I save the file.
UPDATE: Really sadly, I think the generated character still gets converted to spaces... Am checking...
There is an Action in JetBrains IDEs to enter a Tab character.
Here are the steps to use the Tab character action: (discovered in PyCharm 2020.3)
Double-tap the Shift key OR Help -> Find Action...
Type the 3 characters tab
Click on the action that is called Tab and shows the icon for the Tab character...
It remembers the last action you did, so if you have several tabs to add, you can get into a quick process by doing ShiftShift then Return each time.
Answer based on #Morfic's comment to the question. I think this is the cleanest and most sensible reply here so I figured it deserves a place as an answer (and needless to say, it worked for me).
If they're different types of files you could configure File -> Settings -> Editor -> Code style -> Tabs and Indents for each one to use either space or tab depending on how you want it.
One way to do this is to copy a TAB character from another text editor, then right click in your PyCharm file and use Copy / Paste Special -> Paste as Plain Text (Ctrl+Alt+Maj+V)
I guess this was not available in older PyCharm versions, because no other answer proposed it. Regular paste (Ctrl+V) doesn't work (replaced by spaces), but this one works. The function will also bypass other automatic formatting.
Inspired of Clare's suggestion,
assign the left tab key after finding 'tab' action.
At Actions tab, search by 'tab' and move your up/down arrow key and place there.
Then type Ctrl+1, you will see a popup. Select as follows and click OK.
Then, you might be asked "Do you want to remove other assignments?" if Tab key was already assigned. Click Leave because your usage won't conflict with the existing setup.

Navigate to next symbol, in IntelliJ idea (pycharm, rubymine, etc)?

In IntelliJ idea, one can navigate to a symbol using Ctrl+Alt+Shift+N and the docs are here:
http://www.jetbrains.com/idea/webhelp/navigating-to-class-file-or-symbol-by-name.html
Is there a shortcut way to visit the "next" symbol in the list?
A possible use case would be "visit every underscore underscore unicode method in my project".
When the dialog is opened, click on the pin (Show All in View). You can then use the shortcut "Next Occurrence" (ctrl+alt+down).

IntelliJ IDEA missing some classes in autocomplete

I have quite a few libraries attached to my project and in Eclipse it shows me all my classes that are available to me when I press Ctrl+space.
But with IntelliJ IDEA so many are missing and even when I press Ctrl+space twice it still does not show up.
How ever it does come up when I use goto class(Ctrl + N) it fines it ill add 2 print screens as an example:
Opened up a bug on the jetbrains tracker and Peter Gromov got back to me with "its a bug to do with starting a class with a small letter." The said bug is documented here
Peter suggested that I use the new version of Intellij Idea 13 in which this issue was fixed.
Update
It works on Intellij Idea 13 (as suggested by Peter), so indeed it was an issue with the first character being a lower case character.
By default IntelliJ IDEA come with a "first letter" case sensitive. Here's the place to change that value to "None".

IntelliJ equivalent to Eclipse TAB

I'm trying to migrate from Eclipse to IDEA. In Eclipse, when I hit the TAB key while typing in function parameters and in other contextual situations it will forward the cursor to the next place I can type (next parameter, end of the line for semi-colon, etc.). I use it constantly. Is there a way to get similar functionality in IDEA?
There is not direct equivalent to this action. See completion features page for the advanced features.
Regarding the semicolon insertion see Webstorm/Intellij put ";" always at the end of line.
See also Things possible in Eclipse that aren’t possible in IntelliJ?.

Highlight BOTH matching braces into Gedit

Any way to highlight both braces on Gedit?, it's annoying when you have several braces joined and is not clear which one are you pointing.
Highlighting both braces would be a simple solution to know exactly what are the starting and ending ones.
Thanks.
Actually this feature does exist, to an extent anyway, in Gedit (2, in my case). Under preferences there is a check box in the view tab on the bottom called "Bracket Matching".
With that checked you can highlight the opposite bracket delimiter by putting your cursor over its twin. It goes both ways.
However, seeing that I use ruby, which utilizes "do/end" tags instead of curly brackets, I'm still looking for a hack for that. I'll try to remember to come back and share any more information that I find.
I have an option in my gedit 2.30 for this:
Edit -> Preferences -> Bracket Matching
At first I could't find where the preferences are located, I chose the harder option.
1. dconf-editor:
Press Ctrl + Alt + t and type dconf-editor
Go to org --> gnome --> gedit --> preferences
At bracket-matching and turn on flag
2. run in terminal:
gsettings set org.gnome.gedit.preferences.editor bracket-matching true
3. windows-way case:
In Ubuntu 18.04, Gnome 3.28 the preferences are located in the left corner near the Activities.
Preferences --> view --> Highlighting --> Highlight matching brackets
Currently (Gedit 3.14.0) it works as it has been already mentioned:
Preferences -> View thumbnail -> Highlight matching brackets
Both brackets are highlighted.
I suppose you enabled bracket matching (as in mbonnin's answer), but only one bracket is highlighted.
I made a bug report about that (see Highlight the 2 matching brackets) and it was fixed in a recent version of gedit (I think only version 3 contains this fix).