.emacs.d

the most bloated Emacs config on this planet
git clone https://git.trogloxene.org/.emacs.d.git
Log | Files | Refs

commit df9336726ed19f8cb073b2d01bf0379a0160983d
parent e52e40b8d99a04a4891a56bd9bd9b0f2f84f67bf
Author: andsy10 <andsy1016@gmail.com>
Date:   Sun,  2 Aug 2026 04:29:00 +0800

Consolidate terminal config and remove third-party packages

Diffstat:
Minit.el | 8+-------
Dlisp/init-terminal-kbd.el | 82-------------------------------------------------------------------------------
Dlisp/init-terminal-package.el | 93-------------------------------------------------------------------------------
Dlisp/init-terminal-startup.el | 91-------------------------------------------------------------------------------
Dlisp/init-terminal-ui.el | 82-------------------------------------------------------------------------------
Alisp/init-terminal.el | 335+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 336 insertions(+), 355 deletions(-)

diff --git a/init.el b/init.el @@ -33,11 +33,5 @@ (require 'init-kbd) (require 'init-segmentation) (require 'init-local nil t)) - (progn - (require 'init-terminal-startup) - (require 'init-proxy nil t) - (require 'init-elpa) - (require 'init-terminal-package) - (require 'init-terminal-ui) - (require 'init-terminal-kbd))) + (require 'init-terminal)) ;;; init.el ends here diff --git a/lisp/init-terminal-kbd.el b/lisp/init-terminal-kbd.el @@ -1,82 +0,0 @@ -;;; init-terminal-kbd.el --- keybindings -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -;; general -(use-package general) - -(defun open-init-file() - "Open user's init.el file in ~/.emacs.d ." - (interactive) - (find-file "~/.emacs.d/init.el")) - -;; scratch buffer -(if *is-mac* - (general-def "C-c <f12>" 'scratch-buffer) - (general-def "C-c <delete>" 'scratch-buffer) - (general-def "C-c <deletechar>" 'scratch-buffer)) - -;; diff -(general-def diff-mode-map - "M-o" 'other-window) - -;; dired -(general-def dired-mode-map - "b" 'dired-up-directory) - -;; global map with C-c prefix -(general-def - :prefix "C-c" - "e" 'er/expand-region - "k" 'comment-line - "f r" 'recentf - "i" 'imenu) - -;; global map -(general-def - - ;; buffer, file, and window - "<f2>" 'open-init-file - "C-x C-b" 'ibuffer-other-window - "C-x K" 'crux-kill-other-buffers - - ;; edit - "M-c" 'capitalize-dwim - "M-u" 'upcase-dwim - "M-l" 'downcase-dwim - "C-," 'crux-duplicate-current-line-or-region - "C-k" 'crux-smart-kill-line - "C-<backspace>" 'crux-kill-line-backwards - "M-y" 'yank-from-kill-ring - "C-c DEL" 'hungry-delete-backward - "C-c C-DEL" 'hungry-delete-forward - "M-P" 'drag-stuff-up - "M-N" 'drag-stuff-down - "C-M-@" 'er/mark-symbol - "M-@" 'er/mark-word - "C-M-h" 'backward-kill-sexp - - ;; undo - "C-/" 'undo - "C-M-_" 'undo-redo - - ;; navigate - "M-p" 'backward-paragraph - "M-n" 'forward-paragraph - - ;; window - "M-<left>" 'shrink-window-horizontally - "M-<right>" 'enlarge-window-horizontally - "M-<down>" 'shrink-window - "M-<up>" 'enlarge-window - "M-o" 'other-window) - -(add-to-list 'save-some-buffers-action-alist - (list "d" - (lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer))) - "show diff between the buffer and its file")) - -(provide 'init-terminal-kbd) -;;; init-terminal-kbd.el ends here diff --git a/lisp/init-terminal-package.el b/lisp/init-terminal-package.el @@ -1,93 +0,0 @@ -;;; init-terminal-package.el --- major packages -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -(use-package gcmh - :delight - :hook - (emacs-startup . gcmh-mode) - :init - (setq gcmh-idle-delay 'auto - gcmh-auto-idle-delay-factor 10 - gcmh-high-cons-threshold #x4000000)) - -(use-package benchmark-init - :init - (benchmark-init/activate) - :hook - (after-init . benchmark-init/deactivate)) - -(use-package recentf - :hook - (after-init . recentf-mode) - :init - (setq recentf-max-saved-items 30) - :config - (if *is-android* - (add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.org\\'") - (add-to-list 'recentf-exclude "~/org/my-org-note/journal/.*\\.org\\'") - (add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.org"))) - -(use-package savehist - :hook - (after-init . savehist-mode) - :init - (setq enable-recursive-minibuffers t - history-length 50 - savehist-additional-variables '(mark-ring - global-mark-ring - search-ring - regexp-search-ring - extended-command-history) - savehist-autosave-interval 300)) - -(use-package saveplace - :hook - (after-init . save-place-mode)) - -(use-package restart-emacs) - -(use-package autorevert - :delight - :hook - (after-init . global-auto-revert-mode)) - -(use-package crux) - -(use-package hungry-delete) - -(use-package drag-stuff) - -(use-package expand-region - :commands - (er/mark-symbol er/mark-word) - :config - (setq expand-region-smart-cursor t)) - -(use-package savehist - :init - (setq enable-recursive-minibuffers t - history-length 50 - savehist-additional-variables '(mark-ring - global-mark-ring - search-ring - regexp-search-ring - extended-command-history) - savehist-autosave-interval 300) - (savehist-mode)) - -(use-package saveplace - :init - (save-place-mode)) - -(use-package icomplete - :init - (fido-mode) - :config - (keymap-unset minibuffer-local-completion-map "TAB") - (keymap-set minibuffer-local-completion-map "TAB" 'icomplete-force-complete)) - -(provide 'init-terminal-package) -;;; init-terminal-package.el ends here diff --git a/lisp/init-terminal-startup.el b/lisp/init-terminal-startup.el @@ -1,91 +0,0 @@ -;;; init-const.el --- constant and system stuff -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -(global-display-line-numbers-mode 1) - -(defconst *is-mac* (eq system-type 'darwin)) -(defconst *is-linux* (eq system-type 'gnu/linux)) -(defconst *is-windows* (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))) -(defconst *is-android* (if (getenv "TERMUX_VERSION") t nil)) - -(set-selection-coding-system 'utf-8) -(when (fboundp 'set-charset-priority) - (set-charset-priority 'unicode)) -(set-default-coding-systems 'utf-8) -(set-buffer-file-coding-system 'utf-8) -(set-clipboard-coding-system 'utf-8) -(set-file-name-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) -(set-next-selection-coding-system 'utf-8) -(set-selection-coding-system 'utf-8) -(set-terminal-coding-system 'utf-8) -(setq locale-coding-system 'utf-8) -(setq system-time-locale "C") - -(setq backup-directory-alist - `((".*" . ,(expand-file-name "backup/" user-emacs-directory))) - backup-by-copying t - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t) - -(setq auto-save-file-name-transforms - `((".*" ,(expand-file-name "auto-save-list/" user-emacs-directory) t))) - -(put 'scroll-left 'disabled nil) - -(setq create-lockfiles nil) - -(setq ring-bell-function 'ignore) - -(cond - (*is-windows* - (add-to-list 'exec-path (expand-file-name "H/appppppppppp/scoop/apps/")) - (setenv "PATH" (concat (expand-file-name "H/appppppppppp/scoop/apps/") ";" (getenv "PATH")))) - (*is-mac* - (add-to-list 'exec-path (expand-file-name "/opt/homebrew/bin/")) - (setenv "PATH" (concat (expand-file-name "/opt/homebrew/bin/") ":" (getenv "PATH")))) - (*is-linux* - (add-to-list 'exec-path (expand-file-name "~/.guix-home/profile/bin/")) - (setenv "PATH" (concat (expand-file-name "~/.guix-home/profile/bin/") ":" (getenv "PATH"))))) - -(global-auto-revert-mode 1) - -(when (display-graphic-p) - (recentf-mode) - (setq recentf-max-saved-items 30)) - -(delete-selection-mode) - -(setq initial-scratch-message - "") - -(setq native-comp-async-warnings-errors-kind 'silent) - -(if (boundp 'use-short-answers) - (setq use-short-answers t) - (fset 'yes-or-no-p 'y-or-n-p)) - -(setq delete-by-moving-to-trash t) - -(setq xref-search-program - (cond - ((or (executable-find "ripgrep") - (executable-find "rg")) - 'ripgrep) - (t 'grep))) - -(setq word-wrap-by-category t) - -(setq-default indent-tabs-mode nil) - -(setq kill-whole-line t) - -(setq epg-pinentry-mode 'loopback) - -(provide 'init-terminal-startup) -;;; init-terminal-statup.el ends here diff --git a/lisp/init-terminal-ui.el b/lisp/init-terminal-ui.el @@ -1,82 +0,0 @@ -;;; init-terminal-ui.el --- ui and other style customization cofig -*- lexical-binding: t -*- - -;;; Commentary: - -;;; Code: - -;; display file size in mode line -(size-indication-mode t) - -;; display column number in mode line -(column-number-mode t) - -;; highlight current line -(global-hl-line-mode t) - -;; theme -(if (>= (display-color-cells) 16777216) - (progn - (defvar base03 "#062624") - (defvar base02 "#0c2b29") - (defvar base01 "#4d6967") - (defvar base00 "#728e8c") - (defvar base1 "#7f9b99") - (defvar cyan "#01928d") - (defvar blue "#2570cd") - (defvar green "#3a9c36") - (defvar magenta "#d33682") - (defvar yellow "#a87c04") - (defvar orange "#c24713") - (defvar red "#ce2825") - - (custom-set-faces - `(default ((t (:foreground ,base00 :background ,base03)))) - `(cursor ((t (:inverse t)))) - `(region ((t (:exdend t :foreground ,base03 :background ,base00)))) - `(shadow ((t (:foreground ,base01)))) - `(error ((t (:foreground ,orange)))) - `(warning ((t (:foreground ,yellow)))) - `(font-lock-builtin-face ((t (:foreground ,base00 :weight bold :slant normal)))) - `(font-lock-comment-face ((t (:foreground ,base01)))) - `(font-lock-keyword-face ((t (:foreground ,cyan :weight bold)))) - `(font-lock-variable-name-face ((t (:foreground ,blue)))) - `(font-lock-constant-face ((t (:foreground ,blue :weight bold)))) - `(font-lock-string-face ((t (:foreground ,green)))) - `(font-lock-type-face ((t (:foreground ,yellow)))) - `(font-lock-function-name-face ((t (:foreground ,blue)))) - `(hl-line ((t (:background ,base02 :extend t)))) - `(show-paren-match ((t (:foreground ,magenta :weight bold)))) - `(show-paren-mismatch ((t (:foreground ,base03 :background ,red)))) - `(icomplete-first-match ((t (:foreground ,yellow :weight bold)))) - `(completions-common-part ((t (:foreground ,blue)))) - `(minibuffer-prompt ((t (:foreground ,base01 :weight bold)))) - `(line-number ((t (:foreground ,base01 :weight extra-light)))) - `(button ((t (:foreground ,base00 :underline t)))) - `(mode-line ((t (:background ,base00 :foreground ,base03)))) - `(mode-line-inactive ((t (:background ,base02 :foreground ,base00)))) - `(dired-header ((t (:foreground ,green)))) - `(dired-directory ((t (:foreground ,blue)))) - `(dired-ignored ((t (:foreground ,base01)))) - `(isearch ((t (:background ,magenta :foreground ,base03)))) - `(lazy-highlight ((t (:background ,yellow :foreground ,base03)))) - `(isearch-fail ((t (:foreground ,red)))) - `(org-block ((t (:inhert default)))) - `(org-document-title ((t (:inhert default :weight bold)))) - `(org-document-info ((t (:inhert org-document-title)))) - `(eshell-prompt ((t (:foreground ,yellow :weight bold)))) - `(diff-header ((t (:foreground ,base00 :background ,base02)))) - `(diff-file-header ((t (:inherit: diff-header :weight bold)))) - `(diff-hunk-header ((t (:foreground "#c1a059" :background "#253224")))) - `(diff-added ((t (:foreground "#73b971" :background "#103628")))) - `(diff-refine-added ((t (:foreground "#8cc78d" :background "#1d522e")))) - `(diff-removed ((t (:foreground "#e17360" :background "#2d2c25")))) - `(diff-refine-removed ((t (:foreground "#e7917f" :background "#5c3225")))) - `(xref-file-header ((t (:foreground ,base01)))) - `(xref-line-number ((t (:foreground ,green)))) - `(match ((t (:foreground ,base1 :background ,base02 :weight bold)))))) - - (progn - (global-hl-line-mode nil))) - -(provide 'init-terminal-ui) -;;; init-terminal-ui.el ends here diff --git a/lisp/init-terminal.el b/lisp/init-terminal.el @@ -0,0 +1,335 @@ +;;; init-terminal.el --- minimum config -*- lexical-binding: t -*- + +;;; Commentary: + +;;; Code: + +(global-display-line-numbers-mode 1) + +(set-selection-coding-system 'utf-8) +(when (fboundp 'set-charset-priority) + (set-charset-priority 'unicode)) +(set-default-coding-systems 'utf-8) +(set-buffer-file-coding-system 'utf-8) +(set-clipboard-coding-system 'utf-8) +(set-file-name-coding-system 'utf-8) +(set-keyboard-coding-system 'utf-8) +(set-next-selection-coding-system 'utf-8) +(set-selection-coding-system 'utf-8) +(set-terminal-coding-system 'utf-8) +(setq locale-coding-system 'utf-8) +(setq system-time-locale "C") + +(setq backup-directory-alist + `((".*" . ,(expand-file-name "backup/" user-emacs-directory))) + backup-by-copying t + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) + +(setq auto-save-file-name-transforms + `((".*" ,(expand-file-name "auto-save-list/" user-emacs-directory) t))) + +(put 'scroll-left 'disabled nil) + +(setq create-lockfiles nil) + +(setq ring-bell-function 'ignore) + +(cond + (*is-windows* + (add-to-list 'exec-path (expand-file-name "H/appppppppppp/scoop/apps/")) + (setenv "PATH" (concat (expand-file-name "H/appppppppppp/scoop/apps/") ";" (getenv "PATH")))) + (*is-mac* + (add-to-list 'exec-path (expand-file-name "/opt/homebrew/bin/")) + (setenv "PATH" (concat (expand-file-name "/opt/homebrew/bin/") ":" (getenv "PATH")))) + (*is-linux* + (add-to-list 'exec-path (expand-file-name "~/.guix-home/profile/bin/")) + (setenv "PATH" (concat (expand-file-name "~/.guix-home/profile/bin/") ":" (getenv "PATH"))))) + +(global-auto-revert-mode 1) + +(when (display-graphic-p) + (recentf-mode) + (setq recentf-max-saved-items 30)) + +(delete-selection-mode) + +(setq initial-scratch-message + "") + +(setq native-comp-async-warnings-errors-kind 'silent) + +(if (boundp 'use-short-answers) + (setq use-short-answers t) + (fset 'yes-or-no-p 'y-or-n-p)) + +(setq delete-by-moving-to-trash t) + +(setq xref-search-program + (cond + ((or (executable-find "ripgrep") + (executable-find "rg")) + 'ripgrep) + (t 'grep))) + +(setq word-wrap-by-category t) + +(setq-default indent-tabs-mode nil) + +(setq kill-whole-line t) + +(setq epg-pinentry-mode 'loopback) + +(add-hook 'emacs-startup-hook + (lambda () + (setq gc-cons-threshold 4000000))) + +(use-package recentf + :hook + (after-init . recentf-mode) + :init + (setq recentf-max-saved-items 30) + :config + (if *is-android* + (add-to-list 'recentf-exclude "~/storage/shared/my-org-note/journal/.*\\.org\\'") + (add-to-list 'recentf-exclude "~/org/my-org-note/journal/.*\\.org\\'") + (add-to-list 'recentf-exclude "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org\\.org"))) + +(use-package savehist + :hook + (after-init . savehist-mode) + :init + (setq enable-recursive-minibuffers t + history-length 50 + savehist-additional-variables '(mark-ring + global-mark-ring + search-ring + regexp-search-ring + extended-command-history) + savehist-autosave-interval 300)) + +(use-package saveplace + :hook + (after-init . save-place-mode)) + +(use-package autorevert + :delight + :hook + (after-init . global-auto-revert-mode)) + +(use-package savehist + :init + (setq enable-recursive-minibuffers t + history-length 50 + savehist-additional-variables '(mark-ring + global-mark-ring + search-ring + regexp-search-ring + extended-command-history) + savehist-autosave-interval 300) + (savehist-mode)) + +(use-package saveplace + :init + (save-place-mode)) + +(use-package icomplete + :init + (fido-mode) + :config + (keymap-unset minibuffer-local-completion-map "TAB") + (keymap-set minibuffer-local-completion-map "TAB" 'icomplete-force-complete)) + +;; display file size in mode line +(size-indication-mode t) + +;; display column number in mode line +(column-number-mode t) + +;; highlight current line +(global-hl-line-mode t) + +;; theme +(if (>= (display-color-cells) 16777216) + (progn + (defvar base03 "#062624") + (defvar base02 "#0c2b29") + (defvar base01 "#4d6967") + (defvar base00 "#728e8c") + (defvar base1 "#7f9b99") + (defvar cyan "#01928d") + (defvar blue "#2570cd") + (defvar green "#3a9c36") + (defvar magenta "#d33682") + (defvar yellow "#a87c04") + (defvar orange "#c24713") + (defvar red "#ce2825") + + (custom-set-faces + `(default ((t (:foreground ,base00 :background ,base03)))) + `(cursor ((t (:inverse t)))) + `(region ((t (:exdend t :foreground ,base03 :background ,base00)))) + `(shadow ((t (:foreground ,base01)))) + `(error ((t (:foreground ,orange)))) + `(warning ((t (:foreground ,yellow)))) + `(font-lock-builtin-face ((t (:foreground ,base00 :weight bold :slant normal)))) + `(font-lock-comment-face ((t (:foreground ,base01)))) + `(font-lock-keyword-face ((t (:foreground ,cyan :weight bold)))) + `(font-lock-variable-name-face ((t (:foreground ,blue)))) + `(font-lock-constant-face ((t (:foreground ,blue :weight bold)))) + `(font-lock-string-face ((t (:foreground ,green)))) + `(font-lock-type-face ((t (:foreground ,yellow)))) + `(font-lock-function-name-face ((t (:foreground ,blue)))) + `(hl-line ((t (:background ,base02 :extend t)))) + `(show-paren-match ((t (:foreground ,magenta :weight bold)))) + `(show-paren-mismatch ((t (:foreground ,base03 :background ,red)))) + `(icomplete-first-match ((t (:foreground ,yellow :weight bold)))) + `(completions-common-part ((t (:foreground ,blue)))) + `(minibuffer-prompt ((t (:foreground ,base01 :weight bold)))) + `(line-number ((t (:foreground ,base01 :weight extra-light)))) + `(button ((t (:foreground ,base00 :underline t)))) + `(mode-line ((t (:background ,base00 :foreground ,base03)))) + `(mode-line-inactive ((t (:background ,base02 :foreground ,base00)))) + `(dired-header ((t (:foreground ,green)))) + `(dired-directory ((t (:foreground ,blue)))) + `(dired-ignored ((t (:foreground ,base01)))) + `(isearch ((t (:background ,magenta :foreground ,base03)))) + `(lazy-highlight ((t (:background ,yellow :foreground ,base03)))) + `(isearch-fail ((t (:foreground ,red)))) + `(org-block ((t (:inhert default)))) + `(org-document-title ((t (:inhert default :weight bold)))) + `(org-document-info ((t (:inhert org-document-title)))) + `(eshell-prompt ((t (:foreground ,yellow :weight bold)))) + `(diff-header ((t (:foreground ,base00 :background ,base02)))) + `(diff-file-header ((t (:inherit: diff-header :weight bold)))) + `(diff-hunk-header ((t (:foreground "#c1a059" :background "#253224")))) + `(diff-added ((t (:foreground "#73b971" :background "#103628")))) + `(diff-refine-added ((t (:foreground "#8cc78d" :background "#1d522e")))) + `(diff-removed ((t (:foreground "#e17360" :background "#2d2c25")))) + `(diff-refine-removed ((t (:foreground "#e7917f" :background "#5c3225")))) + `(xref-file-header ((t (:foreground ,base01)))) + `(xref-line-number ((t (:foreground ,green)))) + `(match ((t (:foreground ,base1 :background ,base02 :weight bold)))))) + + (progn + (global-hl-line-mode nil))) + +(defun open-init-file() + "Open user's init.el file in ~/.emacs.d ." + (interactive) + (find-file "~/.emacs.d/init.el")) + +(defun crux-get-positions-of-line-or-region () + "Return positions (beg . end) of the current line or region." + (let (beg end) + (if (and mark-active (> (point) (mark))) + (exchange-point-and-mark)) + (setq beg (line-beginning-position)) + (if mark-active + (exchange-point-and-mark)) + (setq end (line-end-position)) + (cons beg end))) + +(defun crux-duplicate-current-line-or-region (arg) + "Duplicates the current line or region ARG times. +If there's no region, the current line will be duplicated. However, if +there's a region, all lines that region covers will be duplicated." + (interactive "p") + (pcase-let* ((origin (point)) + (`(,beg . ,end) (crux-get-positions-of-line-or-region)) + (region (buffer-substring-no-properties beg end))) + (dotimes (_i arg) + (goto-char end) + (newline) + (insert region) + (setq end (point))) + (goto-char (+ origin (* (length region) arg) arg)))) + +(defun er/looking-back-on-line (regexp) + "Version of `looking-back' that only checks current line." + (looking-back regexp (line-beginning-position))) + +(defun er/mark-symbol () + "Mark the entire symbol around or in front of point." + (interactive) + (let ((symbol-regexp "\\s_\\|\\sw")) + (when (or (looking-at symbol-regexp) + (er/looking-back-on-line symbol-regexp)) + (skip-syntax-forward "_w") + (set-mark (point)) + (skip-syntax-backward "_w")))) + +(defun er/mark-word () + "Mark the entire word around or in front of point." + (interactive) + (let ((word-regexp "\\sw")) + (when (or (looking-at word-regexp) + (er/looking-back-on-line word-regexp)) + (skip-syntax-forward "w") + (set-mark (point)) + (skip-syntax-backward "w")))) + +;; scratch buffer +(if *is-mac* + (keymap-global-set "C-c <f12>" #'scratch-buffer) + (keymap-global-set "C-c <delete>" #'scratch-buffer) + (keymap-global-set "C-c <deletechar>" #'scratch-buffer)) + +;; diff +(with-eval-after-load 'diff-mode + (keymap-set diff-mode-map "M-o" #'other-window)) + +;; dired +(with-eval-after-load 'dired + (keymap-set dired-mode-map "b" #'dired-up-directory)) + + +;; global map + +;; buffer, file, and window +(keymap-global-set "<f2>" #'open-init-file) +(keymap-global-set "C-x C-b" #'ibuffer-other-window) + +;; edit +(keymap-global-set "M-c" #'capitalize-dwim) +(keymap-global-set "M-u" #'upcase-dwim) +(keymap-global-set "M-l" #'downcase-dwim) +(keymap-global-set "C-," #'crux-duplicate-current-line-or-region) +(keymap-global-set "M-y" #'yank-from-kill-ring) +(keymap-global-set "M-z" #'avy-zap-to-char-dwim) +(keymap-global-set "M-Z" #'avy-zap-up-to-char-dwim) +(keymap-global-set "M-P" #'drag-stuff-up) +(keymap-global-set "M-N" #'drag-stuff-down) +(keymap-global-set "C-M-@" #'er/mark-symbol) +(keymap-global-set "M-@" #'er/mark-word) +(keymap-global-set "C-M-h" #'backward-kill-sexp) +(keymap-global-set "C-c e" #'er/expand-region) +(keymap-global-set "C-c k" #'comment-line) + +;; undo +(keymap-global-set "C-/" #'undo) +(keymap-global-set "C-M-_" #'undo-redo) + +;; navigate +(keymap-global-set "M-p" #'backward-paragraph) +(keymap-global-set "M-n" #'forward-paragraph) + +;; window +(keymap-global-set "M-<left>" #'shrink-window-horizontally) +(keymap-global-set "M-<right>" #'enlarge-window-horizontally) +(keymap-global-set "M-<down>" #'shrink-window) +(keymap-global-set "M-<up>" #'enlarge-window) +(keymap-global-set "M-o" #'other-window) + +;; other +(keymap-global-set "C-c f r" #'recentf) + +(add-to-list 'save-some-buffers-action-alist + (list "d" + (lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer))) + "show diff between the buffer and its file")) + +(provide 'init-terminal) +;;; init-terminal.el ends here