Using a macbook pro keyboard for developing software. Typing square brackets and curly braces
Navigate to /System/Library/Input Methods/PressAndHold.app/Contents/PlugIns/PAH_Extension.appex/Contents/Resources/.
  Make a backup of the relevant keyboard file for your locale. In my case, this is Keyboard-en.plist or Keyboard-en_GB.plist.
  Add custom characters or change the characters that you wish, then save the file.
  Log out and back in for the changes to take effect in all apps.
  


For example, you can add the following:

&lt;!-- language: xml --&gt;

    &lt;key&gt;Roman-Accent-0&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;Direction&lt;/key&gt;
        &lt;string&gt;right&lt;/string&gt;
        &lt;key&gt;Keycaps&lt;/key&gt;
        &lt;string&gt;{ [&lt;/string&gt;
        &lt;key&gt;Strings&lt;/key&gt;
        &lt;string&gt;{ [&lt;/string&gt;
    &lt;/dict&gt;


Files in /System are protected by System Integrity Protection. If you wish to edit the file, you will need to disable this if you haven't done so already.


  To disable System Integrity Protection, you can do the following:
  
  
  Boot into the Recovery HD by restarting whilst holding ⌘R.
  Open Terminal (from the Utilities menu).
  Run the following command in Terminal:

csrutil disable

  Restart.
  


Disable OS X El Capitan Rootless and permit write actions to System Integrity Protection locations

You can re-enable it once you've edited the file.