Update
This commit is contained in:
@@ -44,6 +44,6 @@
|
||||
;; (push '(ns-appearance . light) default-frame-alist))
|
||||
|
||||
;; Prevent flash of unstyled mode line
|
||||
(setq mode-line-format nil)
|
||||
;; (setq mode-line-format nil)
|
||||
|
||||
(provide 'early-init)
|
||||
|
||||
16
history
Normal file
16
history
Normal file
@@ -0,0 +1,16 @@
|
||||
;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-emacs-unix -*-
|
||||
;; Minibuffer history file, automatically generated by ‘savehist’.
|
||||
|
||||
(setq savehist-minibuffer-history-variables '(minibuffer-history consult--line-history rg-files-history rg-pattern-history file-name-history extended-command-history buffer-name-history))
|
||||
(setq minibuffer-history '("cmake-mode MELPA"))
|
||||
(setq consult--line-history '("ss"))
|
||||
(setq rg-files-history '("elisp"))
|
||||
(setq rg-pattern-history '("ss"))
|
||||
(setq file-name-history '("~/.emacs.d/init.el" "~/.emacs.d/lisp/" "~/.emacs.d/lisp/init-coding.el" "~/.emacs.d/lisp/init-better-default.el" "~/.emacs.d/lisp/init-coding.el" "~/.emacs.d/lisp/init-shell.el" "~/.emacs.d/init.el" "~/.emacs.d/lisp/init-snippet.el" "~/.emacs.d/lisp/init-ui.el" "~/.emacs.d/lisp/init-vcs.el" "~/.emacs.d/lisp/init-workspace.el" "~/.emacs.d/early-init.el" "~/.emacs.d/lisp/init-edit.el" "~/.emacs.d/lisp/init-utils.el" "~/uni/Seminars/Algebraic Geometry/exer.tex" "~/.emacs.d/lisp/init-completion.el" "~/.emacs.d/lisp/init-eglot.el" "~/org/roam/20260222193638-ring.org" "~/org/yunnan.org" "~/org/workout.org" "~/org/todo.org" "~/org/notes.org" "~/org/learn-haskell.org" "~/org/diary.org" "~/org/roam/20260105223044-ideal_of_ring.org" "~/Library/texmf/tex/latex/local/elegantbook.cls" "~/.emacs.d/auctex/elegantbook.el" "~/Library/Rime/wubi091.dict.yaml" "~/Library/Rime/wubi091.schema.yaml" "~/.emacs.d/snippets/LaTeX-mode/in" "~/.emacs.d/snippets/LaTeX-mode/not in" "~/Library/Rime/pinyin_simp.txt" "~/.emacs.d/rime/user.yaml" "~/.emacs.d/snippets/LaTeX-mode/sqrt" "~/.emacs.d/bookmarks.eld" "~/org/roam/20260322143810-noetherian_topological_space_is_compact.org" "~/.config/aerospace/aerospace.toml" "~/.config/sketchybar/plugins/current_space.sh" "~/.config/sketchybar/sketchybarrc" "~/.config/sketchybar/plugins/aerospace.sh" "~/.emacs.d/lisp/init-org.el" "~/.emacs.d/elpaca/builds/org/org-loaddefs.el" "~/.emacs.d/lisp/init-tex.el" "~/uni/undergrad/26s1/Geometry/ass1/main.tex" "~/.emacs.d/snippets/LaTeX-mode/.yas-ignore-filenames-as-triggers" "~/uni/undergrad/26s1/Geometry/" "~/uni/undergrad/26s1/PFi/main.tex" "~/.emacs.d/snippets/LaTeX-mode/chastar.yasnippet" "~/.emacs.d/snippets/LaTeX-mode/star" "~/.emacs.d/snippets/LaTeX-mode/substar.yasnippet" "~/.emacs.d/snippets/LaTeX-mode/Display Math" "~/.emacs.d/snippets/LaTeX-mode/implied by" "~/.emacs.d/snippets/LaTeX-mode/less or equal" "~/.emacs.d/snippets/LaTeX-mode/lesser lesser" "~/.emacs.d/snippets/LaTeX-mode/greater or equal" "~/.emacs.d/snippets/LaTeX-mode/lrangle" "~/.emacs.d/eshell/alias" "~/.emacs.d/.gitignore" "~/.latexmkrc" "~/.emacs.d/lisp/init-window.el" "~/uni/undergrad/26s1/.projectile" "~/.emacs.d/snippets/LaTeX-mode/bigop.yasnippet" "~/org/roam/20260222194140-category_theory.org" "~/uni/Seminars/Representation theory/.projectile" "~/uni/Seminars/Representation theory/main.tex" "~/.emacs.d/snippets/LaTeX-mode/odot" "~/.emacs.d/snippets/LaTeX-mode/supset" "~/Library/texmf/tex/latex/local/auto/elegantbook.el" "~/uni/Seminars/Algebraic Geometry/auto/exer.el" "~/.config/nvim/LuaSnip/tex/math-commands.lua" "~/.emacs.d/snippets/LaTeX-mode/supseteq" "~/uni/Seminars/Representation theory/auto/main.el" "~/.emacs.d/auctex/auto/elegantbook.el" "~/org/roam/20260307170815-the_first_isomorphism_theorem.org" "~/org/roam/20251208162138-eu4_chinese_on_linux.org" "~/org/roam/20251207033411-quant.org" "~/org/roam/20251117171745-emacs.org" "~/.emacs.d/README.org" "~/.cache/org-persist/d8/df010c-12af-4345-96ea-38c574c74b6f-782ac370c3e966153f81b05909bf82d8.png" "~/org/todo.org_archive" "~/build-emacs-for-macos/flake.nix" "~/build-emacs-for-macos/go.mod" "~/build-emacs-for-macos/Brewfile" "~/.emacs.d/lisp/init-hydra.el" "~/docker_compose/yama.toml" "~/.emacs.d/snippets/LaTeX-mode/cap" "~/.emacs.d/snippets/LaTeX-mode/cup" "~/.emacs.d/snippets/LaTeX-mode/template" "~/build-emacs-for-macos/builds/Emacs.app/Contents/Resources/lisp/loaddefs.el.gz" "~/uni/undergrad/25s1/VCA/Notes/Vector-Calculus-Note.tex" "~/.emacs.d/lisp/init-dashboard.el"))
|
||||
(setq extended-command-history '("easysession-reset" "elpaca-browse" "savehist-mode" "xref-find-definitions" "elisp-enable-lexical-binding" "elpaca-browse" "transient-posframe-mode" "elpaca-browse" "elisp-enable-lexical-binding" "transient-posframe-mode" "elpaca-browse" "proced" "elpaca-browse" "eldoc-mode" "benchmark-init/show-durations-tabulated"))
|
||||
(setq buffer-name-history '("*Proced*"))
|
||||
(setq projectile-project-command-history '#s(hash-table test equal))
|
||||
(setq mark-ring 'nil)
|
||||
(setq global-mark-ring 'nil)
|
||||
(setq search-ring '(#("cod" 0 3 (isearch-case-fold-search t isearch-regexp-function nil)) #("recentf" 0 7 (isearch-case-fold-search t isearch-regexp-function nil)) #("doom-mode" 0 9 (isearch-case-fold-search t isearch-regexp-function nil)) #("easy" 0 4 (isearch-case-fold-search t isearch-regexp-function nil)) #("use-package rg" 0 14 (isearch-case-fold-search t isearch-regexp-function nil))))
|
||||
(setq regexp-search-ring 'nil)
|
||||
2
init.el
2
init.el
@@ -23,6 +23,8 @@
|
||||
|
||||
(require 'init-snippet)
|
||||
(require 'init-coding)
|
||||
(require 'init-vcs)
|
||||
(require 'init-shell)
|
||||
(require 'init-check)
|
||||
(require 'init-eglot)
|
||||
|
||||
|
||||
@@ -61,7 +61,29 @@
|
||||
:ensure nil
|
||||
:hook (elpaca-after-init . recentf-mode)
|
||||
:custom
|
||||
(recentf-max-saved-items 500))
|
||||
(recentf-max-saved-items 500)
|
||||
(recentf-exclude
|
||||
'("\\.?cache" ".cask" "url" "COMMIT_EDITMSG\\'" "bookmarks"
|
||||
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
||||
"\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
|
||||
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "/persp-confs/"
|
||||
(lambda (file) (file-in-directory-p file package-user-dir))))
|
||||
:config
|
||||
(push (expand-file-name recentf-save-file) recentf-exclude)
|
||||
(add-to-list 'recentf-filename-handlers #'abbreviate-file-name)
|
||||
)
|
||||
|
||||
(use-package savehist
|
||||
:ensure nil
|
||||
:hook (elpaca-after-init . savehist-mode)
|
||||
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
|
||||
history-length 1000
|
||||
savehist-additional-variables '(mark-ring
|
||||
global-mark-ring
|
||||
search-ring
|
||||
regexp-search-ring
|
||||
extended-command-history)
|
||||
savehist-autosave-interval 300))
|
||||
|
||||
(setq-default cursor-type 'bar)
|
||||
(setq make-backup-files nil)
|
||||
@@ -104,6 +126,12 @@
|
||||
:bind (([remap kill-ring-save] . easy-kill)
|
||||
([remap mark-sexp] . easy-mark)))
|
||||
|
||||
(use-package browse-kill-ring
|
||||
:bind ("C-c k" . browse-kill-ring)
|
||||
:hook (elpaca-after-init . browse-kill-ring-default-keybindings)
|
||||
:init (setq browse-kill-ring-separator "────────────────"
|
||||
browse-kill-ring-separator-face 'shadow))
|
||||
|
||||
(use-package ultra-scroll
|
||||
:init
|
||||
(setq scroll-conservatively 3
|
||||
|
||||
@@ -1,67 +1,37 @@
|
||||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(use-package transient)
|
||||
|
||||
(use-package magit
|
||||
:bind (("C-c g" . magit-dispatch))
|
||||
:config
|
||||
(setq magit-show-long-lines-warning nil)
|
||||
)
|
||||
|
||||
(setq system-uses-terminfo nil)
|
||||
(setq compilation-environment '("TERM=xterm-256color"))
|
||||
(setq eshell-banner-message "")
|
||||
|
||||
|
||||
(use-package eat
|
||||
:bind ("C-`" . eat-toggle)
|
||||
:hook ((eshell-load . eat-eshell-mode)
|
||||
(eshell-load . eat-eshell-visual-command-mode))
|
||||
:ensure `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||
:custom
|
||||
(eat-term-name "xterm-256color")
|
||||
(eat-kill-buffer-on-exit t)
|
||||
(eat-shell )
|
||||
:config
|
||||
(defun eat-toggle () (interactive)
|
||||
(if (string= (buffer-name) "*eshell*")
|
||||
(delete-window)
|
||||
(eshell)))
|
||||
|
||||
(setq tramp-remote-process-environment '("TERM=xterm-256color" "TERMINFO=''" "ENV=''" "TMOUT=0" "LC_CTYPE=''" "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" "autocorrect=" "correct="))
|
||||
(when (eq system-type 'darwin)
|
||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||
|
||||
(use-package eshell-prompt-extras
|
||||
:after esh-opt
|
||||
:defines eshell-highlight-prompt
|
||||
:autoload (epe-theme-lambda epe-theme-dakrone epe-theme-pipeline)
|
||||
(use-package xref
|
||||
:ensure nil
|
||||
:init
|
||||
(setq eshell-highlight-prompt t
|
||||
eshell-prompt-function #'epe-theme-lambda))
|
||||
;; Use faster search tool
|
||||
(when (executable-find "rg")
|
||||
(setq xref-search-program 'ripgrep))
|
||||
|
||||
(use-package eshell-z
|
||||
:hook (eshell-mode . (lambda () (require 'eshell-z))))
|
||||
;; Select from xref candidates in minibuffer
|
||||
(setq xref-show-definitions-function #'xref-show-definitions-completing-read
|
||||
xref-show-xrefs-function #'xref-show-definitions-completing-read))
|
||||
|
||||
(use-package esh-help
|
||||
:commands setup-esh-help-eldoc
|
||||
:init (setup-esh-help-eldoc))
|
||||
|
||||
(use-package eshell-syntax-highlighting
|
||||
:after eshell-mode
|
||||
:hook (elpaca-after-init . eshell-syntax-highlighting-global-mode))
|
||||
(use-package apheleia
|
||||
:diminish
|
||||
:hook (elpaca-after-init . apheleia-global-mode))
|
||||
|
||||
(use-package editorconfig
|
||||
:diminish
|
||||
:hook elpaca-after-init)
|
||||
|
||||
(use-package yaml-mode)
|
||||
(use-package cask-mode)
|
||||
(use-package csv-mode)
|
||||
(use-package cue-sheet-mode)
|
||||
(use-package dart-mode)
|
||||
(use-package lua-mode)
|
||||
(use-package v-mode)
|
||||
(use-package vimrc-mode)
|
||||
(use-package julia-ts-mode)
|
||||
(use-package scala-ts-mode)
|
||||
(use-package yaml-ts-mode
|
||||
:ensure nil
|
||||
:mode ("\\.yaml\\'" . yaml-ts-mode))
|
||||
|
||||
;; Fish shell mode and auto-formatting
|
||||
(use-package fish-mode
|
||||
:commands fish_indent-before-save
|
||||
|
||||
@@ -260,10 +260,6 @@
|
||||
;; (with-eval-after-load 'corfu
|
||||
;; (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)))
|
||||
|
||||
(use-package wgrep
|
||||
:commands wgrep-change-to-wgrep-mode
|
||||
:config (setq wgrep-auto-save-buffer t))
|
||||
|
||||
;; A few more useful configurations...
|
||||
(use-package emacs
|
||||
:ensure nil
|
||||
|
||||
@@ -126,8 +126,19 @@
|
||||
(use-package undo-fu-session
|
||||
:hook (elpaca-after-init . undo-fu-session-global-mode))
|
||||
|
||||
;; Process
|
||||
(use-package proced
|
||||
:ensure nil
|
||||
:init
|
||||
(setq-default proced-format 'verbose)
|
||||
(setq proced-auto-update-flag t
|
||||
proced-auto-update-interval 3
|
||||
proced-enable-color-flag t))
|
||||
|
||||
(use-package olivetti
|
||||
:hook org-mode
|
||||
:diminish
|
||||
:bind ("<f7>" . olivetti-mode)
|
||||
:custom
|
||||
(olivetti-style 'fancy)
|
||||
(olivetti-margin-width 5)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
(use-package jsonrpc)
|
||||
|
||||
(use-package eglot
|
||||
:defer t
|
||||
:hook ((prog-mode . (lambda ()
|
||||
(unless (derived-mode-p
|
||||
'emacs-lisp-mode 'lisp-mode
|
||||
|
||||
102
lisp/init-shell.el
Normal file
102
lisp/init-shell.el
Normal file
@@ -0,0 +1,102 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package shell
|
||||
:ensure nil
|
||||
:hook ((shell-mode . my/shell-mode-hook)
|
||||
(comint-output-filter-functions . comint-strip-ctrl-m))
|
||||
:init
|
||||
(setq system-uses-terminfo nil)
|
||||
|
||||
(with-no-warnings
|
||||
(defun my/shell-simple-send (proc command)
|
||||
"Various PROC COMMANDs pre-processing before sending to shell."
|
||||
(cond
|
||||
;; Checking for clear command and execute it.
|
||||
((string-match "^[ \t]*clear[ \t]*$" command)
|
||||
(comint-send-string proc "\n")
|
||||
(erase-buffer))
|
||||
;; Checking for man command and execute it.
|
||||
((string-match "^[ \t]*man[ \t]*" command)
|
||||
(comint-send-string proc "\n")
|
||||
(setq command (replace-regexp-in-string "^[ \t]*man[ \t]*" "" command))
|
||||
(setq command (replace-regexp-in-string "[ \t]+$" "" command))
|
||||
;;(message (format "command %s command" command))
|
||||
(funcall 'man command))
|
||||
;; Send other commands to the default handler.
|
||||
(t (comint-simple-send proc command))))
|
||||
|
||||
(defun my/shell-mode-hook ()
|
||||
"Shell mode customization."
|
||||
(local-set-key '[up] 'comint-previous-input)
|
||||
(local-set-key '[down] 'comint-next-input)
|
||||
(local-set-key '[(shift tab)] 'comint-next-matching-input-from-input)
|
||||
|
||||
(ansi-color-for-comint-mode-on)
|
||||
(setq comint-input-sender 'my/shell-simple-send))))
|
||||
|
||||
(use-package xterm-color
|
||||
:defines (compilation-environment
|
||||
eshell-preoutput-filter-functions
|
||||
eshell-output-filter-functions)
|
||||
:init
|
||||
;; For shell and interpreters
|
||||
(setenv "TERM" "xterm-256color")
|
||||
|
||||
(with-eval-after-load 'esh-mode
|
||||
(add-hook 'eshell-before-prompt-hook
|
||||
(lambda ()
|
||||
(setq xterm-color-preserve-properties t)))
|
||||
(add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
|
||||
(setq eshell-output-filter-functions
|
||||
(remove 'eshell-handle-ansi-color eshell-output-filter-functions)))
|
||||
(setq compilation-environment '("TERM=xterm-256color"))
|
||||
)
|
||||
|
||||
(setq eshell-banner-message "")
|
||||
|
||||
(use-package eat
|
||||
:bind ("C-`" . eat-toggle)
|
||||
:hook ((eshell-load . eat-eshell-mode)
|
||||
(eshell-load . eat-eshell-visual-command-mode))
|
||||
:ensure `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||
:custom
|
||||
(eat-term-name "xterm-256color")
|
||||
(eat-kill-buffer-on-exit t)
|
||||
;; (eat-shell )
|
||||
:config
|
||||
(defun eat-toggle () (interactive)
|
||||
(if (string= (buffer-name) "*eshell*")
|
||||
(delete-window)
|
||||
(eshell)))
|
||||
|
||||
(setq tramp-remote-process-environment '("TERM=xterm-256color" "TERMINFO=''" "ENV=''" "TMOUT=0" "LC_CTYPE=''" "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" "autocorrect=" "correct="))
|
||||
(when (eq system-type 'darwin)
|
||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||
|
||||
(use-package eshell-prompt-extras
|
||||
:after esh-opt
|
||||
:defines eshell-highlight-prompt
|
||||
:autoload (epe-theme-lambda epe-theme-dakrone epe-theme-pipeline)
|
||||
:init
|
||||
(setq eshell-highlight-prompt t
|
||||
eshell-prompt-function #'epe-theme-lambda))
|
||||
|
||||
;; (use-package eshell-z
|
||||
;; :hook (eshell-mode . (lambda () (require 'eshell-z))))
|
||||
|
||||
;; (use-package esh-help
|
||||
;; :commands setup-esh-help-eldoc
|
||||
;; :init (setup-esh-help-eldoc))
|
||||
|
||||
(use-package eshell-syntax-highlighting
|
||||
:after eshell-mode
|
||||
:hook (elpaca-after-init . eshell-syntax-highlighting-global-mode))
|
||||
|
||||
|
||||
(provide 'init-shell)
|
||||
@@ -27,4 +27,9 @@
|
||||
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
||||
(yas-expand)))))
|
||||
|
||||
;; Collection of yasnippet snippets
|
||||
(use-package yasnippet-snippets)
|
||||
|
||||
|
||||
|
||||
(provide 'init-snippet)
|
||||
|
||||
@@ -101,20 +101,18 @@
|
||||
;; (setq prism-parens t))
|
||||
|
||||
(use-package rainbow-mode
|
||||
:hook elpaca-after-init)
|
||||
|
||||
;; (use-package mood-line
|
||||
;; :hook elpaca-after-init)
|
||||
:hook text-mode
|
||||
:hook prog-mode)
|
||||
|
||||
(use-package doom-modeline
|
||||
:hook (elpaca-after-init . doom-modeline-mode)
|
||||
:config
|
||||
(setq doom-modeline-support-imenu t
|
||||
doom-modeline-height 30
|
||||
doom-modeline-buffer-file-name-style 'buffer-name
|
||||
doom-modeline-buffer-file-name-style 'relative-from-project
|
||||
doom-modeline-enable-word-count t
|
||||
doom-modeline-project-detection 'projectile
|
||||
doom-modeline-project-name t
|
||||
;; doom-modeline-project-name t
|
||||
doom-modeline-check 'simple
|
||||
doom-modeline-buffer-encoding nil
|
||||
doom-modeline-major-mode-icon nil))
|
||||
|
||||
@@ -195,6 +193,24 @@
|
||||
:ensure t
|
||||
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
|
||||
|
||||
;; Display transient in child frame
|
||||
;; (use-package transient-posframe
|
||||
;; :diminish
|
||||
;; :commands transient-posframe-mode
|
||||
;; :custom-face
|
||||
;; (transient-posframe-border ((t (:inherit posframe-border :background unspecified))))
|
||||
;; :hook elpaca-after-init
|
||||
;; :init (setq transient-mode-line-format nil
|
||||
;; transient-posframe-parameters '((left-fringe . 8)
|
||||
;; (right-fringe . 8))))
|
||||
|
||||
(with-no-warnings
|
||||
(when (featurep 'ns)
|
||||
;; Render thinner fonts
|
||||
(setq ns-use-thin-smoothing t)
|
||||
;; Don't open a file in a new frame
|
||||
(setq ns-pop-up-frames nil)))
|
||||
|
||||
(use-package beacon
|
||||
:diminish
|
||||
:hook elpaca-after-init)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package rg)
|
||||
|
||||
(use-package which-key
|
||||
:diminish
|
||||
:functions childframe-completion-workable-p
|
||||
@@ -12,16 +10,23 @@
|
||||
which-key-lighter nil
|
||||
which-key-show-remaining-keys t)
|
||||
:config
|
||||
(which-key-add-key-based-replacements "C-c n" "org-mode")
|
||||
(which-key-add-key-based-replacements "C-c a" "LSP")
|
||||
(which-key-add-key-based-replacements "C-c c" "code")
|
||||
(which-key-add-key-based-replacements "C-c c" "code")
|
||||
(which-key-add-key-based-replacements "C-c n" "org")
|
||||
(which-key-add-key-based-replacements "C-c l" "llm")
|
||||
(which-key-add-key-based-replacements "C-c s" "session")
|
||||
(which-key-add-key-based-replacements "C-c f" "find")
|
||||
(which-key-add-key-based-replacements "C-c p" "project")
|
||||
(which-key-add-key-based-replacements "C-x p" "project")
|
||||
(which-key-add-key-based-replacements "C-c !" "flycheck")
|
||||
(which-key-add-key-based-replacements "C-c &" "yasnippet")
|
||||
(which-key-add-key-based-replacements "C-c q" "quit")
|
||||
(which-key-add-key-based-replacements "C-c C-w" "workspace")
|
||||
(which-key-add-key-based-replacements "C-c w" "windows"))
|
||||
(which-key-add-key-based-replacements "C-c w" "windows")
|
||||
(which-key-add-key-based-replacements "C-x a" "abbrevs")
|
||||
(which-key-add-key-based-replacements "C-x b" "abbrevs")
|
||||
(which-key-add-key-based-replacements "C-x r" "rectangle/bookmarks")
|
||||
(which-key-add-key-based-replacements "C-x t" "tabs")
|
||||
(which-key-add-key-based-replacements "C-x v" "version control"))
|
||||
|
||||
(use-package grep
|
||||
:ensure nil
|
||||
@@ -37,6 +42,21 @@
|
||||
(grep-apply-setting
|
||||
'grep-find-template "rg --color=auto --null -nH --no-heading -e <R> <D>")))
|
||||
|
||||
;; Writable grep buffer
|
||||
(use-package wgrep
|
||||
:init (setq wgrep-auto-save-buffer t
|
||||
wgrep-change-readonly-file t))
|
||||
|
||||
;; Fast search tool `ripgrep'
|
||||
(use-package rg
|
||||
:hook (elpaca-after-init . rg-enable-default-bindings)
|
||||
:bind (:map rg-global-map
|
||||
("c" . rg-dwim-current-dir)
|
||||
("f" . rg-dwim-current-file)
|
||||
("m" . rg-menu))
|
||||
:init (setq rg-show-columns t)
|
||||
:config (add-to-list 'rg-custom-type-aliases '("tmpl" . "*.tmpl")))
|
||||
|
||||
(use-package pdf-tools
|
||||
:config
|
||||
(pdf-tools-install))
|
||||
|
||||
91
lisp/init-vcs.el
Normal file
91
lisp/init-vcs.el
Normal file
@@ -0,0 +1,91 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package transient)
|
||||
|
||||
(use-package magit
|
||||
:bind (("C-c g" . magit-dispatch))
|
||||
:custom
|
||||
(magit-diff-refine-hunk t)
|
||||
(git-commit-major-mode 'git-commit-elisp-text-mode)
|
||||
:config
|
||||
(setq magit-show-long-lines-warning nil))
|
||||
|
||||
;; Prime cache before Magit refresh
|
||||
(use-package magit-prime
|
||||
:diminish
|
||||
:hook elpaca-after-init)
|
||||
|
||||
;; Show TODOs in Magit
|
||||
(use-package magit-todos
|
||||
:after magit-status
|
||||
:commands magit-todos-mode
|
||||
:init
|
||||
(setq magit-todos-nice (if (executable-find "nice") t nil))
|
||||
(magit-todos-mode 1))
|
||||
|
||||
;; Walk through git revisions of a file
|
||||
(use-package git-timemachine
|
||||
:custom-face
|
||||
(git-timemachine-minibuffer-author-face ((t (:inherit success :foreground unspecified))))
|
||||
(git-timemachine-minibuffer-detail-face ((t (:inherit warning :foreground unspecified))))
|
||||
:bind (:map vc-prefix-map
|
||||
("t" . git-timemachine))
|
||||
:hook ((git-timemachine-mode . (lambda ()
|
||||
"Improve `git-timemachine' buffers."
|
||||
;; Highlight symbols in elisp
|
||||
(when (derived-mode-p 'emacs-lisp-mode)
|
||||
(and (fboundp 'highlight-defined-mode)
|
||||
(highlight-defined-mode t)))
|
||||
|
||||
;; Display line numbers
|
||||
(when (derived-mode-p 'prog-mode 'yaml-mode 'yaml-ts-mode)
|
||||
(and (fboundp 'display-line-numbers-mode)
|
||||
(display-line-numbers-mode t)))))
|
||||
(before-revert . (lambda ()
|
||||
(when (bound-and-true-p git-timemachine-mode)
|
||||
(user-error "Cannot revert the timemachine buffer"))))))
|
||||
|
||||
(use-package smerge-mode
|
||||
:ensure nil
|
||||
:diminish
|
||||
:pretty-hydra
|
||||
((:title (pretty-hydra-title "Smerge" 'octicon "nf-oct-diff")
|
||||
:color pink :quit-key ("q" "C-g"))
|
||||
("Move"
|
||||
(("n" smerge-next "next")
|
||||
("p" smerge-prev "previous"))
|
||||
"Keep"
|
||||
(("b" smerge-keep-base "base")
|
||||
("u" smerge-keep-upper "upper")
|
||||
("l" smerge-keep-lower "lower")
|
||||
("a" smerge-keep-all "all")
|
||||
("RET" smerge-keep-current "current")
|
||||
("C-m" smerge-keep-current "current"))
|
||||
"Diff"
|
||||
(("<" smerge-diff-base-upper "upper/base")
|
||||
("=" smerge-diff-upper-lower "upper/lower")
|
||||
(">" smerge-diff-base-lower "upper/lower")
|
||||
("R" smerge-refine "refine")
|
||||
("E" smerge-ediff "ediff"))
|
||||
"Other"
|
||||
(("C" smerge-combine-with-next "combine")
|
||||
("r" smerge-resolve "resolve")
|
||||
("k" smerge-kill-current "kill")
|
||||
("ZZ" (lambda ()
|
||||
(interactive)
|
||||
(save-buffer)
|
||||
(bury-buffer))
|
||||
"Save and bury buffer" :exit t))))
|
||||
:bind (:map smerge-mode-map
|
||||
("C-c m" . smerge-mode-hydra/body))
|
||||
:hook ((find-file . (lambda ()
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^<<<<<<< " nil t)
|
||||
(smerge-mode 1)))))
|
||||
(magit-diff-visit-file . (lambda ()
|
||||
(when smerge-mode
|
||||
(smerge-mode-hydra/body))))))
|
||||
|
||||
|
||||
(provide 'init-vcs)
|
||||
@@ -49,6 +49,7 @@
|
||||
(eyebrowse-new-workspace t))
|
||||
|
||||
(use-package easysession
|
||||
:diminish
|
||||
:demand t
|
||||
;; :hook (elpaca-after-init easysession-scratch-mode)
|
||||
;; :hook (elpaca-after-init easysession-magit-mode)
|
||||
@@ -59,14 +60,14 @@
|
||||
("s-5" . eyebrowse-switch-to-window-config-5)
|
||||
("s-6" . eyebrowse-switch-to-window-config-6)
|
||||
("s-7" . eyebrowse-switch-to-window-config-7)
|
||||
("s-8" . eyebrowse-switch-to-window-config-8)
|
||||
("C-c s l" . easysession-switch-to)
|
||||
("C-c s L" . easysession-switch-to-and-restore-geometry)
|
||||
("C-c s s" . easysession-save)
|
||||
("C-c s r" . easysession-rename)
|
||||
("C-c s R" . easysession-reset)
|
||||
("C-c s u" . easysession-unload)
|
||||
("C-c s d" . easysession-delete))
|
||||
("s-8" . eyebrowse-switch-to-window-config-8))
|
||||
;; ("C-c C-s l" . easysession-switch-to)
|
||||
;; ("C-c C-s L" . easysession-switch-to-and-restore-geometry)
|
||||
;; ("C-c C-s s" . easysession-save)
|
||||
;; ("C-c C-s r" . easysession-rename)
|
||||
;; ("C-c C-s R" . easysession-reset)
|
||||
;; ("C-c C-s u" . easysession-unload)
|
||||
;; ("C-c C-s d" . easysession-delete))
|
||||
|
||||
:custom
|
||||
(easysession-switch-to-save-session t)
|
||||
|
||||
Reference in New Issue
Block a user