Posts for: #Mac

Making Home and End Buttons Work Correctly on a Mac

For the most part, using a Mac has been pretty easy after many years of using Windows. One of the really annoying changes though was the way the Home and End keyboard keys work. On a Mac they go to the start and end of the file rather than the line. If you’re like me, this seems really silly. To change it, do the following:

  1. Open Terminal (Cmd + Space, type “Terminal”).
  2. Create the KeyBindings directory by pasting this command:
mkdir -p ~/Library/KeyBindings
  1. Create and open the configuration file:
nano ~/Library/KeyBindings/DefaultKeyBinding.dict
  1. Paste the following code into the window:
{
    "\UF729"  = "moveToBeginningOfLine:";
    "\UF72B"  = "moveToEndOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
}
  1. Press Ctrl + X, then Y, and Enter to exit.
  2. Restart your Mac (or log out and back in) for the changes to take effect.

Note: The lines starting with $ handle Shift + Home/End, allowing you to highlight the line just like on Windows.

[Read more]

Mapping an SMB Share on a Mac via Terminal

To map an SMB share on a Mac via the terminal:

  1. Create a new folder to act as the mount point. This is essentially a proxy for the folder on the remote machine.
mkdir ~/share-home
  1. Enter this command to link the new folder to the share.
mount -t smbfs //user@share-host/share-name ~/share-home
  • user: your SMB user name on the machine hosting the SMB share.
  • share-host : The IP address or network name of the SMB host machine.
  • share-name : The name of the SMB share.
  • ~/share-home : The name of the folder we created in step 1.

After that you can access the files in the share from the folder created in step 1. Note that this is temporary and will not persist after a reboot.

[Read more]