(require 'magit)
(global-set-key (kbd "C-x m") 'magit-status)
;; C-x C-k to kill file on line
(defun magit-kill-file-on-line ()
"Show file on current magit line and prompt for deletion."
(interactive)
(magit-visit-item)
(delete-current-buffer-file)
(magit-refresh))
(define-key magit-status-mode-map (kbd "C-x C-k") 'magit-kill-file-on-line)
;; full screen magit-status
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defun magit-quit-session ()
"Restores the previous window configuration and kills the magit buffer"
(kill-buffer)
(jump-to-register :magit-fullscreen))
(define-key magit-status-mode-map (kbd "q") 'magit-quit-session)
(defun magit-toggle-whitespace ()
(if (member "-w" magit-diff-options)
(magit-dont-ignore-whitespace)
(magit-ignore-whitespace)))
(defun magit-ignore-whitespace ()
(add-to-list 'magit-diff-options "-w")
(defun magit-dont-ignore-whitespace ()
(setq magit-diff-options (remove "-w" magit-diff-options))
(define-key magit-status-mode-map (kbd "W") 'magit-toggle-whitespace)