This is part of the Emacs Starter Kit.
- Use Ido with Magit.
- Setting the full path for Git makes Magit a little bit faster.
(setq magit-completing-read-function 'magit-ido-completing-read)
(setq magit-git-executable (executable-find "git"))
Use magit-ediff e on un-merged item.
Use magit-discard-item k on item.
I almost never use version control system bundled with Emacs and it always slows down Emacs. Disable it completely.
(setq vc-handled-backends nil)
I always handles my project and important files through Git so there is no need for backup files.
(setq make-backup-files nil)
(defun ediff-buffer-with-auto-save ()
"Find and display differences between current buffer and its auto save
file."
(interactive)
(let ((auto-save-file-name
(make-auto-save-file-name)))
(if (file-exists-p auto-save-file-name)
(ediff-buffers (current-buffer)
(find-file-noselect (make-auto-save-file-name)))
(user-error "Current buffer has no auto save file!"))))
To compare current buffer with its associated file, use diff-buffer-with-file.
(defun toggle-git-gutter-and-linum ()
(interactive)
(cond
((and linum-mode git-gutter-mode)
(git-gutter-mode -1))
((and linum-mode (not git-gutter-mode))
(linum-mode -1)
(git-gutter-mode 1))
((and (not linum-mode) git-gutter-mode)
(git-gutter-mode -1)
(linum-mode 1))
(t
(linum-mode 1))))