I pushed a magic button and now my cursor (the blinking thing that shows where you type) split itself and now Eclipse is acting like a plain text editor/like Microsoft Word. The cursor, which usually looks like "|", now looks like "¦" (what Wikipedia calls a 'broken bar' or a 'parted rule' rather than a normal 'vertical bar').
I just want to know how to get Eclipse to act normal again, and what I accidentally did so I don't do it again.
It sounds like you have accidentally switched from Smart Insert mode to Insert mode.
Press Ctrl + Shift + Insert or tick Smart Insert Mode on the Edit menu to switch back.
Smart Insert is the feature that automatically insert closing quotes and brackets when you type the opener and places semi-colons at the end of the line when you press semi-colon (if you have the preference for that enabled.)
Maybe you pressed the insert key, which will change the Eclipse editor to Overwrite rather than Smart Insert (see the info bar at the bottom of the editor), and will change the cursor to a block rather than a vertical line?
Update: Thanks for clarification - see mikej's answer which is correct. I'll leave this answer in case anyone has the similar, related problem that I describe.
Just double click on "Smart Insert" / "Overwrite" in eclipse status bar
For reference, I am adding image.
If nothing works, restart eclipse. That is what I did !
Just click
Toggle Vrapper Icon in Toolbar..
That may causes some issues like these. Because I'm also faced the same issue until today.
Please refer the below images to get clear idea about this.
Make sure that it is in disable mode in status bar
On my windows computer I press Shift + 0 but the zero has to be on the numeric keypad not the top row numbers.
Shift + 0 toggle my cursor.
#Jeremy by saying " I have a vertical line with a gap in the middle of it, like the character above the forward slash " i guess you are referring to the ' Pipeline 'symbol, the one you use to denote' OR ' in programming languages. As people already answered, you are in Raw Insert Mode (as opposed to Smart Mode) so try Edit->Smart Insert Mode (Ctrl+Shift+Insert by default).
For more info you can visit this thread http://www.eclipse.org/forums/index.php/t/53833/
And remember, the symbol is called 'Pipe' symbol or 'Pipeline' symbol.
I also had same problem, you can fix this by pressing just INSERT button on keyboard (on windows platform) also.
It worked for me.
or you can restart your eclipse.
I've encountered this symptom in Eclipse 3.7 before. And after I restarted machine, it disappeared.
If your cursor symbol is " + " then press Alt+Shift+A.
or else we can use Edit menu options ==> Toggle Block Selections
If you are using spring tool suite then you can double click on highlighted Smart Insert . Some keyboards do not have insert button.
enter image description here
Related
I've recently switched from Eclipse to IntelliJ IDEA 13. I use the VI keybindings.
One non-vi thing I am used to doing in Eclipse is using Shift + ↑ / Shift + ↓ to block a few lines of text. The behaviour of this text selection in Eclipse is the same as almost every other text input widget I've ever used. Typically I do one of two things after making the selection - delete this block or comment it out (⌘ + /).
I have no found equivalent keyboard-only multi-line selection function in IntelliJ IDEA 13.
Shift + ↑ does not start a block selection - it seems to page the cursor up and down the screen.
If I use the mouse to start making a selection, then the arrow keys do extend the selection. However, I'm unable to start a selection using the keyboard alone.
I'm aware of the ⌘ + W ever-outward-growing smart element selection - but if you then use the arrow keys, the selection is lost, not extended.
How can I start and then extend a selection region across multiple lines using the keyboard only on Mac OS X (that works with the VI keybindings enabled)?
Multi-line caret
For Mac, you can use ⌘+⌘(Hold)+↑ / ↓.
For Windows, replace the ⌘ with CTRL.
ESC will end multi-line mode.
Change Multi-caret Hotkey
To add a custom Keymap, ⌘+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of ⌘, SHIFT, and arrows for improved selection power.
Sounds like you need to map it. In the default key mapping Shift+↑ and Shift+↓ work as expected (i.e. as you describe). I do not have the vi mapping available to check it. Go into Settings > [IDE Settings] > Keymap. In the Keymap, go to "Editor Actions". Configure the "Down with Selection" and "Up with Selection" options. This may mean removing the Shift+↑ and Shift+↓ mappings from something else.
I use the IdeaVIM plugin on Mac OS and I can increase or decrease my selection with the keyboard only with alt-Up/Down.
It is possible I customized the VIM keymap to this, can't remember if it is default or not. However, the editor action you are looking for in the keymap settings is "Select Word at Caret" and "Unselect Word at Caret". Repeatedly pressing the keystroke smartly selects/unselects the text. It almost always selects what I want.
You can use alt+Up/Down/Right/Left or alt+mouse-select to block select on mac in IntelliJ
When I first learned Java, I was using an IDE called "BlueJ." It had this feature called "Scope Highlighting" which made it very easy to read blocks of code. Now I've moved on from BlueJ and began using Eclipse. I'm currently in the process of customizing Eclipse to my liking and would like this Scope Highlighting feature inside Eclipse.
I've searched everywhere for an answer on how to do it but I cannot find any information pointing to a solution for doing it in Eclipse.
Here's a picture to demonstrate what Scope Highlighting looks like:
I think the best option for you is EditBox, a scope highlighting plugin for Eclipse:
http://editbox.sourceforge.net/
I'm afriad that closest you can get is Shift + Alt + arrow_up
It is selecting wider block of code. pressing this few times will give you very similar result to what you are searching for. I use it often.. it is useful, also for refactoring.
EDIT: As #j2emanue said: you can just double click the delimiter (like a bracket) and it will highlight the entire scope.
you can use Shift + Alt + arrow_up but many people dont realize you can just double click the delimiter (like a bracket) and it will highlight the entire scope. Try double clicking your if statements bracket for example and watch eclipse highlight the entire scope. It works with any delimiter. so you can use parenthesis as well.
as a side note: if your using intelliji checkout this plugin works great: https://github.com/izhangzhihao/intellij-rainbow-brackets#screenshots
This isn't exactly what you're after but you can put your cursor in a method and then click the Show Source Of Selected Element only button on the toolbar. Your editor gets reduced to just that method. Click again and your back to your entire file.
I doubt eclipse does have the same function as blue j.The best advise I can give you, is to change your theme to your liking which would enable you to easily select and highlight the block of code...and to customise your theme , go to http://eclipsecolorthemes.org/. ....
If you still have a problem, go to http://codejava.co.uk/contact.html and send your email.you can create a dummy one if want, then I will send you XML files I use for my eclipse themes.
can Bracketeer do this ? its an eclipse plug in ..
http://marketplace.eclipse.org/content/bracketeer-java-jdt#.UK6sY4fAdLc
Maybe you will also like the VSCode extension "Blockman". It highlights nested code blocks based on curly/square/round brackets, html/xml tags and Python/Yaml indentation. (I am the author of Blockman).
.
https://i.ibb.co/31F0rm9/vscode-blockman-intro-leodevbro-extension3.png
.
.
When I edit code in the middle of statements, it replaces the current code around it. I cannot find a way to replace this with a normal cursor that only inserts data instead of replacing it. Is that functionality possible in Eclipse?
The problem is also identified in your status bar at the bottom:
You are in overwrite mode instead of insert mode.
The “Insert” key toggles between insert and overwrite modes.
It sounds like you hit the "Insert" key .. in most applications this results in a fat (solid rectangle) cursor being displayed, as your screenshot suggests. This indicates that you are in overwrite mode rather than the default insert mode.
Just hit the "insert" key on your keyboard once more... it's usually near the 'delete' (not backspace), scroll lock and 'Print Screen' (often above the cursor keys in a full size keyboard.)
This will switch back to insert mode and turn your cursor into a vertical line rather than a rectangle.
You might have pressed 0 (also used for insert, shortcut INS) key, which is on the right side of your right scroll button. To solve the problem, just press it again or double click on 'overwrite'.
This problem, in my case, wasn't related to the Insert key. It was related to Vrapper being enabled and editing like Vim, without my knowledge.
I just toggled the Vrapper Icon in Eclipse top bar of menus and then pressed the Insert Key and the problem was solved.
Hopefully this answer will help someone in the future.
In my case, it's related to the Toggle Vrapper Icon in the Eclipse.
If you are getting the bold black cursor, then the icon must be enabled. So, click on the Toggle Vrapper Icon to disable. It's located in the Eclipse's Toolbar. Please see the attached image for the clarity.
This issue can happen not only in eclipse but also in any of the text-editor.
On windows systems, windows-10 in my case, this issue arose when the shift and insert key was pressed in tandem unintentionally which takes the user to the overwrite mode.
To get back to insert mode you need to press shift and insert in tandem again.
Currently the Eclipse autocompletion seems only to be triggered after a dot or on parameters, I want to use it for variables too, e.g. if I have
String test="hello";
then I want the autocompletion to suggest "test" if I start typing "t" in the next line (e.g. if I intent to change the value of the variable test).
Is there any Eclipse plugin capable of doing this? I already checked the Eclipse content assist options, but seems like there no option for what I want? Thanks for any hint!
First of all, thanks for all the replies. They are correct, however you have to press the key combination each time. Here's how it's done automatically:
That plug-in is not necessary any more. Just go to
Preferences > Java > Editor > Content Assist
and paste:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
into the "Auto activation triggers for Java:" field.
This simply triggers auto activation after any English alphabet character and after dot.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159157#c12
Works fine :-)
Hint: You probably want to additionally set the auto activation delay to 0, at least if you are used to visual studio ;-)
In addition to the suggestions above, did you try ALT + / it does incremental matching? No?
ctrl + space
If you press ctrl+space key combination, eclipse will show you the code assist window.
Type t and then hit ctrl+space, it will show you possible matches
You can press "t" and then Ctrl+Space..
is it?
In Eclipse
Window--->Preferences---> search for Content Assist under Content Assist go for Advanced
and check the Java Praposals.
done.
Anyone know the keyboard shortcut to copy/paste a line into a new line in Eclipse, without having to highlight the entire line?
ctrl-alt-down turns my whole screen upside down (I'm on windows). Interestingly, that's what's specified in the windows->preferences.
Ctrl-Alt-Down: copies current line or selected lines to below
Ctrl-Alt-Up:: copies current line or selected lines to above
Ctrl-Shift-L: brings up a List of shortcut keys
See Windows/Preference->General->Keys.
(Tested on Windows) [Per below comments, works as well in Ubuntu, IBM RTC 4 / RSA 9]
In Eclipse, press Ctrl+Shift+L two
times in succession (or Ctrl + 3 > type: Keys > Enter).
In 'type filter text' (search) text box, type Copy Lines
Select the filtered row, right click the 'Binding' field, and do Select All
Press Ctrl+Shift+V
Give OK
From now on, for any line you want to duplicate, just press Ctrl+Shift+V.
You have to turn off the graphics hot keys that flip the screen. If you're on Windows, you need to right click on the Windows desktop and select "Graphics Properties..." (or something similar depending on your version of Windows). This will bring up a screen where you can manage graphics and display options, look for a place where you can disable hot keys, sometimes it's hidden under something like "Options and Support". Turn off the CTRL + ALT + ↑ and CTRL + ALT + ↓ hotkeys (alternatively you can just disable all graphics hot keys if you're not using them).
If you want to copy a line to the clipboard you can also use the trick:
Ctrl-Alt-Down
followed by
Ctrl-X
The drawback is that the file where you copy the line from becomes dirty.
Ctrl-D would delete a line
Ctrl-Z would undo deletion, with highlithing entire line
Ctrl-X/C cut or copy entire line
The advantage over Ctrl-Alt-Down followed by Ctrl-X suggested by other users is that it doesn't make eclipse think that the file was changed in any way. It's also faster and causes no problems even if the user has rotating screen issue with Ctrl-Alt-Down/Up keyboard shorcut. So there's no need to remap shorcuts for this.
Another way to go would be hitting Alt-Shift-Up until the entire line gets selected. If you've gone too far, of course you can select less with Alt-Shift-Down.
If Your Window pc, you may try this, it's also for STS:
Ctrl + win + Alt + Down :: Copy current line or selected line to below
Ctrl + win + Alt + Up :: Copy current line or selected line to above
I've written the linecopypaste plugin for Eclipse that mimics Visual Studio's copy/cut/paste behaviour. I've also found copycutcurrentline which appears to do the same.
On my Mac the default setting is is ALT+CMD+Down
You can change/view all key bindings by going Eclipse -> Preferences (shortcut CMD+,) and then General -> Keys
Ctrl+Alt+Down Copies current line to below like notepad++ (Ctrl+D)
If your whole screen is 180° rotted then you should disable your hotkey settings.
Right Click -> Graphics Options -> Hot Keys -> Disable
That it now you done try shortcut Ctrl+Alt+Down
Try this in MAC.
ALT + COMMAND + DOWN
it works.
If anyone using Mac computer the CTRL + ALT + DOWN keys doesn't work.
Try it with,
ALT + COMMAND + DOWN
It works.
We can assign any command to any action(given) in Eclipse
From Menu Bar go to
Window > Preferences
then search for the keys
then search copy line
then click on copy line and then click on command in Binding
and peform a command which you wish to use for duplicating line i use ctrl+shift+d
you can choose whatever you want
On Mac, I've tried the linecopypaste and it works great
cmd+c -> Copy current (unselected) line, just like "yy" command in Vi/Vim
cmd+v -> Paste it, like "p" command in Vi/Vim
Thank's Larsch for your work!
PD: Using Eclipse Luna 4.4.2 in Yosemite
I have to change the assigned key,
e.g.
Windows/Preference --> General --> Keys
Select "Duplicate Lines" under command
Click on "Binding"
Ctrl + Shift + D
Just another approach:
1) Alt+Up and Alt+Down (or Alt+Down and Alt+Up, order does not matter)
2) Ctrl+C
But of course vim's "yy" is the fastest :)
Disabling the hot keys for the Intel Driver worked for me for Windows 7. However, for Windows 8, when I tried that, it prevented eclipse from getting the Ctrl-Alt-Down keystoke. I had to change the Intel driver key binding to Ctrl-Alt-F10 (or something else it will accept). Eclipse then gets the Ctrl-Alt-Down and copies the line.
For mac, shift+alt+down_arrow works in netbeans' editor.
It's working with me on ,
Eclipse + Spring tool suite .
ALT + COMMAND + DOWN
I am using Windows 7. To disable that all I did is to Right click on the Windows desktop and select "Graphics Properties" ->Options. Then selected "Off" at the left side on the resulting screen. This disabled all hotkey combination. I think there is no way to disable only some them, its all or none. Anyway I didn't need them. So now crtl+Alt+Up and Crtl+Alt+down works for me in Eclipse and my screen stays same :)
I think similar option also exist in other versions of Windows. Have fun :)
For personal usage, I add a vim plugin like Vrapper to Eclipse and just use yy to copy entire line.
The Ctrl+Alt+Down / Ctrl+Alt+Up flips my screen so I overrode that in the Eclipse shortcuts via
Window => Preferences => General => Keys.
Search for "dupl" to find the Duplicate Lines command. I overrode the default and chose Ctrl+Shift+D. For me, that's easy to remember just like Ctrl+D to delete lines
ctrl+alt+down/up/left/right takes precedence over eclipse settings as hot keys. As an alternative, I try different approach.
Step 1: Triple click the line you want to copy & press `Ctrl`-`C`(This will
select & copy that entire line along with the `new line`).
Step 2: Put your cursor at the starting of the line where you want to to paste
your copied line & press `Ctrl`-`V`.(This will paste that entire line & will
push previous existing line to the new line, which we wanted in the first place).
The combination of Ctrl + Shift + Alt + Down worked for me on Linux.
To copy text from the begining of line to the cursor position: ctrl + insert
It does the job and save a lot of time for me.
Another shortcut way to do this is press Ctrl+Shift+L and select which command you want to perform and hit enter
its best practice for beginner.
See how to make the eclipse default shortcut work ctrl alt↓
Select line: Put cursor on the line to copy, select line with ShiftHome if cursor in the end of line or ShiftEnd if cursor is in starting of line
Duplicate line below (default expected behavior) or above ctrl alt↓ or ctrl alt ↑ but the key here is you need to select the line/block
Some answers focus on disabling the screen Rotation in Windows or any other OS, that applies to prevent accidental keypress.