Emacs tips and hacks

Suppress splash screen

Default behavior for emacs is to display the splash screen upon opening, even if you’re opening a file in it (which results in an annoying split screen). To force emacs to NOT show the splash screen, add this to ~/.emacs

(setq inhibit-splash-screen t)

Change default save directory (Windows)

To change the default save directory in Windows (ugh), simply edit your shortcut. Go to Properties>Shortcut> and change “Start in” to the directory of your choice.

Setting Custom Keybindings

C-c char is reserved for custom keybindings. You can set a keybinding for a long command with options by adding a new function and calling it.

(defun mycommand ()
  (interactive)
  (command_here)
  )
(global-set-key (kbd "C-c i") 'mycommand)

If it’s a single command with no options, you don’t need to create a new function and can call it as shown.

Advertisements