Skip to content

Instantly share code, notes, and snippets.

@kpb
Last active December 10, 2020 00:52
Show Gist options
  • Save kpb/88dab655325d7647360879656255bb5a to your computer and use it in GitHub Desktop.
Save kpb/88dab655325d7647360879656255bb5a to your computer and use it in GitHub Desktop.
Sundry Emacs Foo

Edit Local File with su/sudo

I always forget this syntax...

C-x C-f /su::/etc/hosts
C-x C-f /sudo::/etc/hosts

Split window into 3 even vertical windows

C-x 3 C-x 3 C-x +

(defun split-3-windows-horizontally-evenly ()
  (interactive)
  (command-execute 'split-window-horizontally)
  (command-execute 'split-window-horizontally)
  (command-execute 'balance-windows)
)

(global-set-key (kbd "C-x <whatever keys you like") 'split-3-windows-horizontally-evenly)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment