Turn off Macbook automatic hibernation mode? I'm having a problem with my MacBook Pro (mid 2012) where by when I lock my machine and then return several hours later (at least six hours) it will not respond to me pressing the keyboard.

I have to press the power button and then it boots up requiring a password.  Once this password has been entered it takes a few minutes to slowly start all of my processes again (I hear skype logging in behind the blue screen) eventually my bluetooth mouse and keyboard are connected.  Finally I can then enter my password to actually gain access to my machine.

This is a problem I've had with OSX since Mavericks was released.

Below is a screenshot of the settings I have tried to change (everything possible) to stop this stupid behaviour and it still persists!
From a Terminal, use the following command to disable hibernation:

sudo pmset -a hibernatemode 0


If you later want to enable hibernation, use:

sudo pmset -a hibernatemode 3


If you want to free up the disk space used by hibernation, use the following command:

sudo rm /var/vm/sleepimage



Note: This file is automatically recreated as needed if hibernation is reenabled and it doesn't already exist.