Remove unused packages
This commit is contained in:
@@ -1,108 +0,0 @@
|
||||
;;; init-git.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
(setq vc-follows-symlinks t
|
||||
find-file-visit-truename t
|
||||
vc-handled-backends nil)
|
||||
|
||||
(if (display-graphic-p)
|
||||
(use-package git-gutter-fringe
|
||||
:ensure t
|
||||
:config
|
||||
(global-git-gutter-mode t)
|
||||
(setq-default fringes-outside-margins nil)
|
||||
(setq-default left-fringe-width 10)
|
||||
(set-face-foreground 'git-gutter-fr:modified "purple")
|
||||
(set-face-foreground 'git-gutter-fr:added "green")
|
||||
(set-face-foreground 'git-gutter-fr:deleted "red")
|
||||
|
||||
(defun my-reshape-git-gutter (gutter)
|
||||
"Re-shape gutter for `ivy-read'."
|
||||
(let* ((linenum-start (aref gutter 3))
|
||||
(linenum-end (aref gutter 4))
|
||||
(target-line "")
|
||||
(target-linenum 1)
|
||||
(tmp-line "")
|
||||
(max-line-length 0))
|
||||
(save-excursion
|
||||
(while (<= linenum-start linenum-end)
|
||||
(with-no-warnings
|
||||
(goto-line linenum-start))
|
||||
(setq tmp-line (replace-regexp-in-string "^[ \t]*" ""
|
||||
(buffer-substring (line-beginning-position)
|
||||
(line-end-position))))
|
||||
(when (> (length tmp-line) max-line-length)
|
||||
(setq target-linenum linenum-start)
|
||||
(setq target-line tmp-line)
|
||||
(setq max-line-length (length tmp-line)))
|
||||
|
||||
(setq linenum-start (1+ linenum-start))))
|
||||
;; build (key . linenum-start)
|
||||
(cons (format "%s %d: %s"
|
||||
(if (eq 'deleted (aref gutter 1)) "-" "+")
|
||||
target-linenum target-line)
|
||||
target-linenum)))
|
||||
|
||||
(defun my-goto-git-gutter ()
|
||||
(interactive)
|
||||
(eval-when-compile (require 'git-gutter-fringe nil t))
|
||||
(when (and (require 'git-gutter-fringe nil t)
|
||||
(fboundp 'ivy-read))
|
||||
|
||||
(if git-gutter-fr:diffinfos
|
||||
(ivy-read "git-gutters-fr:"
|
||||
(mapcar 'my-reshape-git-gutter git-gutter-fr:diffinfos)
|
||||
:action (lambda (e)
|
||||
;; ivy9+ keep `(car e)'
|
||||
;; ivy8- strip the `(car e)'
|
||||
;; we handle both data structure
|
||||
(unless (numberp e) (setq e (cdr e)))
|
||||
(with-no-warnings
|
||||
(goto-line e))))
|
||||
(message "NO git-gutters-fringe!"))
|
||||
))))
|
||||
|
||||
(use-package git-modes
|
||||
:ensure t
|
||||
:mode
|
||||
("/\\.?git/?config$" . gitconfig-mode)
|
||||
("/\\.gitmodules$" . gitconfig-mode)
|
||||
("/\\.gitignore$" . gitignore-mode)
|
||||
("/\\.git/info/exclude$" . gitignore-mode)
|
||||
("/git/ignore$" . gitignore-mode)
|
||||
("/.dockerignore\\'" . gitignore-mode)
|
||||
("/\\.gitattributes\\'" . gitattributes-mode)
|
||||
("/info/attributes\\'" . gitattributes-mode)
|
||||
("/git/attributes\\'" . gitattributes-mode))
|
||||
|
||||
(use-package git-timemachine
|
||||
:ensure t
|
||||
:commands git-timemachine
|
||||
:bind (:map git-timemachine-mode
|
||||
("c" . git-timemachine-show-current-revision)
|
||||
("b" . git-timemachine-switch-branch)))
|
||||
|
||||
;;; smerge-mode video explain https://emacsgifs.github.io/public/videos/758861381898637313.mp4
|
||||
(use-package smerge-mode
|
||||
:ensure t
|
||||
:config
|
||||
(defun enable-smerge-maybe ()
|
||||
(when (and buffer-file-name (vc-backend buffer-file-name))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^<<<<<<< " nil t)
|
||||
(smerge-mode +1)))))
|
||||
|
||||
(eval-when-compile (require 'smerge-mode nil t))
|
||||
(when (and (require 'smerge-mode nil t)
|
||||
(fboundp 'enable-smerge-maybe))
|
||||
(add-hook 'buffer-list-update-hook #'enable-smerge-maybe)))
|
||||
|
||||
(provide 'init-git)
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
;;; init-git.el ends here
|
||||
@@ -69,6 +69,7 @@
|
||||
(global-set-key (kbd "<f12>") 'revert-buffer-no-confirm)
|
||||
(global-set-key (kbd "s-h") 'global-hl-line-mode) ; Highlight current line
|
||||
(global-set-key (kbd "M-c") nil) ; disable capitalize-word
|
||||
(global-set-key (kbd "<f6>") 'display-line-numbers-mode)
|
||||
;; muti-curses
|
||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
;;; init-nlinum.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Line numbers
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Linum snippets from: https://www.emacswiki.org/emacs/LineNumbers
|
||||
|
||||
(use-package linum
|
||||
:config
|
||||
(defun my-linum-get-format ()
|
||||
"Defines LINUM-GET-FORMAT"
|
||||
(let* ((width (1+ (length (number-to-string
|
||||
(count-lines (point-min) (point-max))))))
|
||||
(format (concat "%" (number-to-string width) "d \u2502")))
|
||||
(setq my-linum-format-string format)))
|
||||
(add-hook 'linum-before-numbering-hook 'my-linum-get-format)
|
||||
|
||||
(defun my-linum-format (line-number)
|
||||
"Defines LINE-FORMAT"
|
||||
(propertize (format my-linum-format-string line-number) 'face
|
||||
(if (eq line-number my-current-line)
|
||||
'my-linum-hl
|
||||
'linum)))
|
||||
(setq linum-format 'my-linum-format)
|
||||
|
||||
(defadvice linum-update (around my-linum-update)
|
||||
"Defines LINUM-UPDATE for update lines"
|
||||
(let ((my-current-line (line-number-at-pos)))
|
||||
ad-do-it))
|
||||
(ad-activate 'linum-update)
|
||||
|
||||
:bind
|
||||
(([f6] . linum-mode)))
|
||||
|
||||
(provide 'init-linum)
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (not free-vars)
|
||||
;; End:
|
||||
;;; init-linum.el ends here
|
||||
Reference in New Issue
Block a user