In Netbeans IDE, desired behavior is when i press b then space, it creates two curly brackets with cursor in middle

StackOverflow https://stackoverflow.com/questions/1758474

  •  20-09-2019
  •  | 
  •  

Question

when I press b-space for code block it does:

{
(cursor here)
}

How can I go about accomplishing this? Thanks.

Was it helpful?

Solution

Go to Tools/Options/Editor/Code Templates. Create a new template for the letter b (New, type b, Ok), then type the following into Expanded Text:

{
    ${cursor}
}

Finally, set Expand Template on to Space.

By the way, you can get the same behavior by pressing {, and hitting an enter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top