tag (emacs)

archive

removing, changing, and controlling emacs backup files Apr
21
1
0

The default functionality of how emacs handles its backup files annoys me. I don't like how it clutters my folders by leaving a trail of ~ files wherever I go. If you're in the same camp there's a couple of things you can do about it.

You can clean up existing your directories by removing backup files by any number of ways. I like to use one of these commands:

#  from anywhere
find /path/to/directory -name '*~' -exec rm {} \;

# from a directory
rm -rf *~

Then you can either change the backup directory so all files are stored in a common location:

;; add to .emacs file
'(backup-directory-alist (quote (("." . "~/backup/path"))))

or prevent emacs from making backup files in the first place:

;; add to .emacs file
(setq make-backup-files nil) 

comments

.emacs function to split windows Apr
05
1
0

I personally like to split my emacs into three windows. I have a certain setup that I like, and I wrote a function to quickly execute the command sequence C-x 3, C-x o, C-x 2. This way I can quickly switch back and forth from a one to three window setup by typing: M-x split-windows.

I'm quite terrible with Lisp, so I'm posting here so I can remember what I did. I'd like to someday make improvements so that it remembers which buffer was open in each window, but this will do for now.

;; split windows
(defun split-windows ()
  (interactive)
  (split-window-horizontally)
  (other-window 1)
  (split-window-vertically))

comments

reload a file in emacs Apr
05
1
0

You can reload a file in emacs. I typically will come across this situation after I've done a pull.

M-x revert-buffer

comments

how to reload the .emacs file without restarting emacs Apr
05
1
0

If you've made edits to your .emacs file you can reload it without having to restart your emacs.

M-x load-file
~/.emacs

Alternatively you can highlight a region and execute the expression.

c-x c-e

comments