Skip to main content
I've customized my default key bindings on Mac to try and get some conformity amongst my many platforms. I tend to get confused, and these make it easier for me each time I switch around.

For one thing, this fixed the Home and End keys' default behavior. Also tweaked PgUp and PgDown slightly. Then also added shortcuts for the most commonly-used CTRL-<key> variants (like copy and paste).

I've added/created the following file: (also creating the directory)
~/Library/KeyBindings/DefaultKeyBinding.dict

With the text content:

/* ~/Library/KeyBindings/DefaultKeyBinding.dict */

{
      /* Remap Home / End to be correct :-) */
      "\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
      "\UF72B"  = "moveToEndOfLine:";                         /* End          */
      "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
      "$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */

      /* And map old behavior to Ctrl-Key */
      "^\UF729"  = "moveToBeginningOfDocument:";                   /* Ctrl + Home         */
      "^\UF72B"  = "moveToEndOfDocument:";                         /* Ctrl + End          */
      "^$\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Ctrl + Shift + Home */
      "^$\UF72B" = "moveToEndOfDocumentAndModifySelection:";       /* Ctrl + Shift + End  */

      /* Fix PgUp and PgDown to move cursor :-) */
      "\UF72C"  = "pageUp:";                        /* PgUp */
      "\UF72D"  = "pageDown:";                      /* PgDown */
      "$\UF72C" = "pageUpAndModifySelection:";      /* Shift + PgUp */
      "$\UF72D" = "pageDownAndModifySelection:";    /* Shift + PgDown */

      /***** DELETE-INSERT(HELP) KEYS *****/

      /* Note that the Windows "insert" key is the Mac "help" key */
      "$\UF728"   = "cut:";                           /* Shft-FwdDel  Cut */   
      "^\UF746"   = "copy:";                          /* C-Help       Copy */
      "$\UF746"   = "paste:";                         /* Shft-Help    Paste */


      /***** RETURN KEY *****/
      "$\U000A"   = "insertLineBreak:";               /* Shft-Ret     Line break */

      "^\UF702"   = "moveWordLeft:";                  /* C-left       Move word left */
      "^\UF703"   = "moveWordRight:";                 /* C-right      Move word right */

      /***** ARROWS *****/
      "$^\UF702"  = "moveWordLeftAndModifySelection:"; /* C-Shft-left  Select word left */
      "$^\UF703"  = "moveWordRightAndModifySelection:"; /* C-Shft-right Select word right */


      /***** CTRL + LETTERS *****/

      "^a"        = "selectAll:";                     /* C-a          Select all */

      "^x"        = "cut:";                           /* C-x          Cut */
      "^c"        = "copy:";                          /* C-c          Copy */
      "^v"        = "paste:";                         /* C-v          Paste */

      "^z"        = "undo:";                          /* C-z          Undo */
      "^y"        = "redo:";                          /* C-y          Redo */

      "^s"        = "save:";                          /* C-s          Save */
      "^S"        = "saveAs:";                        /* C-Shift-s     Save as */
      "^p"        = "print:";                         /* C-p          Print */
}

Comments

Popular posts from this blog

My Custom Mechanical 60% Keyboard Build

My Custom Mechanical 60% Keyboard Build All the parts   1x GH60 (Satan) board - $35 61x Cherry Clear switches  - $35 2x Cherry Blue switches - $3 10x Cherry Red switches - $10 1x PCB Stabilizer set (6.25 space) - $6 1x Royal Oak Glam 60% case (Black Walnut) - $78 1x Aluminium 60% plate - $19 1x SA profile Choclatier keycaps - $102 ( base, modifiers, and novelties ) 1x Braided Nylon USB cable - $15 Solder, Tools, Risers, Labor, etc. Total: ± $300 (Other single switch types added as needed) Testing the board I had my helper do the work here. We needed to test the board before applying any solder. Assembling Add the stabilizers first Add the plate (using a few switches as spacers) Then add the rest Solder solder solder... And test again: The casing The casing I received did to have built-in risers: So I added my own: Then Assemble (using temporary spare GMK Carbon Cherry-profile keycaps):

Compacting internal memory of SAP tables in ABAP.

How to force-free memory from deleted entries in internal tables in SAP ABAP, since the garbage collector won't touch these. This is only needed in rare occasions and/or when memory fragmentation needs to be avoided. This method will do it fast, and correctly: CLASS cl_demo DEFINITION . PUBLIC SECTION . CLASS - METHODS compact CHANGING ct_tab TYPE ANY TABLE . ENDCLASS . CLASS cl_demo IMPLEMENTATION . METHOD compact . FIELD-SYMBOLS : <lt_buffer> TYPE ANY TABLE , <lt_buffer_std> TYPE STANDARD TABLE , <ls_buffer> TYPE any , <ls_buffer_prev> TYPE any . DATA : ltr_buffer TYPE REF TO data , lsr_buffer TYPE REF TO data , l_kind TYPE c LENGTH 1 . " simple case: IF ct_tab IS INITIAL . FREE ct_tab . RETURN . ENDIF . CREATE DATA ltr_buffer LIKE ct_tab . DESCRIBE TABLE

The story of my Amiga A1200's new lease on life.

Ok, so I rummaged through my storage in South Africa and found my old Amiga once again. This was not the original one I used to have, this is an Amiga A1200, where I used to have the Amiga A500 back in 1986. A bit of history, I started out with a Atari 2600 back in 1983 (was 10 years old at the time), then saw an advertisement for a cartridge that could do programming... this concept fascinated me, but we could never find it anywhere (it was hard finding the good stuff in South Africa). I settled for a VIC-20 soon afterwards (I sold my Atari), then upgraded to a Commodore C64 soon thereafter. This lasted until 1986 (age 13) when, after countless months of pouring over Commodore User magazines, I decided I wanted an Amiga. I had the choice between an IBM compatible XT (with two floppy disc drives but no graphics) or an Amiga. Both seemingly the same price, but due to the then apartheid-era restrictions and taxes, the Amiga turned out to be very troublesome t