improve magit, etc

This commit is contained in:
Erik Osheim 2022-08-02 19:52:50 -04:00
parent 4887d23af3
commit 99685bde8a
1 changed files with 21 additions and 22 deletions

43
init.el
View File

@ -163,23 +163,6 @@
(require 'find-dired) (require 'find-dired)
(setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld")) (setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld"))
;; ;; hippie expand stuff: M-/ to expand things
;; (bind-key "M-/" 'hippie-expand)
;; (defun sanityinc/dabbrev-friend-buffer (other-buffer)
;; (< (buffer-size other-buffer) (* 1 1024 1024)))
;; (setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer)
;; (setq hippie-expand-try-functions-list
;; '(try-expand-all-abbrevs
;; try-complete-file-name-partially
;; try-complete-file-name
;; try-expand-dabbrev
;; try-expand-dabbrev-from-kill
;; try-expand-dabbrev-all-buffers
;; try-expand-list
;; try-expand-line
;; try-complete-lisp-symbol-partially
;; try-complete-lisp-symbol))
;; comment regions using C-c # (uncomment with C-u C-c #) ;; comment regions using C-c # (uncomment with C-u C-c #)
(global-set-key "\C-c#" 'comment-region) (global-set-key "\C-c#" 'comment-region)
(setq comment-empty-lines nil) (setq comment-empty-lines nil)
@ -223,7 +206,6 @@
(use-package racket-mode) (use-package racket-mode)
(use-package tuareg) (use-package tuareg)
(use-package forth-mode) (use-package forth-mode)
(use-package rust-mode) (use-package rust-mode)
(use-package which-key (use-package which-key
@ -385,9 +367,27 @@
;; magit ;; magit
(use-package magit (use-package magit
:commands magit-status magit-blame :commands magit-status magit-blame
:init (setq magit-revert-buffers nil)
:bind (("C-x g" . magit-status) :bind (("C-x g" . magit-status)
("s-b" . magit-blame))) ("s-b" . magit-blame))
:init
;; Have magit-status go full screen and quit to previous
;; configuration. Taken from
;; http://whattheemacsd.com/setup-magit.el-01.html#comment-748135498
;; and http://irreal.org/blog/?p=2253
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defadvice magit-quit-window (after magit-restore-screen activate)
(jump-to-register :magit-fullscreen))
:config (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
(remove-hook 'magit-status-sections-hook 'magit-insert-status-headers)
(remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-pushremote)
(remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-pushremote)
(remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-upstream)
(remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-upstream-or-recent)
(setq magit-refresh-verbose t ; xyz
magit-revert-buffers nil))
(use-package org-roam (use-package org-roam
:if (equal (system-name) "cult") :if (equal (system-name) "cult")
@ -404,8 +404,7 @@
(global-set-key (kbd "C-x n") 'git-gutter:next-hunk)) (global-set-key (kbd "C-x n") 'git-gutter:next-hunk))
;; git-timemachine ;; git-timemachine
(use-package git-timemachine (use-package git-timemachine)
:config (add-hook 'git-timemachine-mode-hook (lambda () (ensime-mode 0))))
;; json ;; json
(use-package json-mode) (use-package json-mode)