Shortcut for brackets "[ ]" on Mac OS

Hi all I would like to know if it's possible to add or change a keyboard shortcut to make brackets "[ ]". They are available by doing Alt + Shift + ( but I would like to change it or add one to just do Cmd+ ( for example at least one thing faster because in programming I will win a lot of time (in my opinion) haha. Thanks in advance ciao!

(I'm on MacOS Sierra)


Solution 1:

On latest MacBook Pro it works like this:

  • ⌥ alt+5 : [

  • ⌥ alt+6 : ]

  • ⌥ alt+8 : {

  • ⌥ alt+9 : }

I would love to have them as shortcuts on the touch bar together with the pipe-symbol | (= ⌥ alt+7) and the backslash \ (= ⌥ alt+Shift+7)!

Solution 2:

alt + 8 worked for me in MacBook Pro and I believe for programming it's convenient.

Solution 3:

In my case using macbook pro 2019 13-inch azerty

option + shift + ( : [
option + shift + ) : ]