Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't type curly braces in Eclipse

Tags:

java

eclipse

ide

I have been working with Java in an Eclipse IDE. I can type every single character just fine except for the '{' character. I need to resort to Ctrl+c and Ctrl+v every single time when I want to create a new block of {}.

In the Window>Preferences>Editor>Typing Braces are on, and they autocorrect just fine after I manage to copy a {.

Outside eclipse, in a text editor, or even in this question, I can type { by hitting Atl Gr + B, so I am thinking the problem is inside Eclipse.

Any help would be really appreciated, this error is getting quite annoying.

like image 298
handris Avatar asked Nov 24 '15 21:11

handris


People also ask

How do you put curly braces in eclipse?

The simplest and global way: Go to Window -> Preferences. Then in search put: "brace". Select -> Java -> Code Style-> Formatter After opening new window go to brace tab and change it as you prefer.

How do you type a curly brace?

If it is a windows keyboard you can do (alt+123) for '{' and (alt+125) for '}'. On a Mac the shortcuts are (shift + alt + 8) for '{' and (shift + alt + 9) for '}'.

How do you write curly braces in Java?

Always include curly brackets. Always include curly brackets, even for one-line if statements or for loops. Java has a "feature" which allows you to omit curly brackets when writing if statements, for loops, or while loops containing only a single statement.

How do you check curly braces in eclipse?

To see a bracket's pair, click to the right of the bracket. Its matching pair will be highlighted. To jump to the matching bracket, press Ctrl+Shift+P.


2 Answers

The problem is with the skip breakpoints option. After unbinding the Alt+B key command, try to unbind the Ctr+Alt+B (skip brakepoints).

This solved my problem. If you try to type the "{" you can see the skip breakpoint option flashing.

like image 55
Gábor Csikós Avatar answered Sep 21 '22 01:09

Gábor Csikós


Go Windows-> Preferences type in search field 'binding' click on Keys, look up for Alt+B, click on it and then click Unbind Command.

like image 39
user6838933 Avatar answered Sep 19 '22 01:09

user6838933