mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-14 16:11:34 +09:00
Emacs : save point
This commit is contained in:
@ -40,7 +40,7 @@ Emacs Configuration for emacs 29.50
|
|||||||
;;; init.el -*- lexical-binding: t; -*-
|
;;; init.el -*- lexical-binding: t; -*-
|
||||||
(add-hook 'emacs-startup-hook
|
(add-hook 'emacs-startup-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(message "Crafted Emacs loaded in %s"
|
(message "Emacs loaded in %s"
|
||||||
(emacs-init-time))))
|
(emacs-init-time))))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Package Function
|
*** Package Function
|
||||||
@ -100,19 +100,6 @@ Emacs Configuration for emacs 29.50
|
|||||||
// -*- mode: js; indent-tabs-mode: nil; tab-width: 4 -*-
|
// -*- mode: js; indent-tabs-mode: nil; tab-width: 4 -*-
|
||||||
// code: language=rust insertSpaces=false tabSize=4
|
// code: language=rust insertSpaces=false tabSize=4
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Line number
|
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
|
||||||
(column-number-mode)
|
|
||||||
(global-display-line-numbers-mode t)
|
|
||||||
;; Disable line numbers for some modes
|
|
||||||
(dolist (mode '(org-mode-hook
|
|
||||||
nov-mode-hook
|
|
||||||
shell-mode-hook
|
|
||||||
treemacs-mode-hook
|
|
||||||
dired-mode-hook
|
|
||||||
eshell-mode-hook))
|
|
||||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
*** Backup options
|
*** Backup options
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
@ -131,20 +118,21 @@ Emacs Configuration for emacs 29.50
|
|||||||
|
|
||||||
*** Other options
|
*** Other options
|
||||||
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
(set-default-coding-systems 'utf-8)
|
(set-default-coding-systems 'utf-8)
|
||||||
(customize-set-variable 'large-file-warning-threshold 100000000) ;; 100MB
|
(set-language-environment "utf-8")
|
||||||
|
(customize-set-variable 'large-file-warning-threshold 100000000) ;; 100MB
|
||||||
|
|
||||||
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
||||||
(defconst ON-MAC (eq system-type 'darwin))
|
(defconst ON-MAC (eq system-type 'darwin))
|
||||||
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
||||||
|
|
||||||
(setq gc-cons-threshold (* 2 1024 1024)) ; decreasing the threshold to 2MB
|
(setq gc-cons-threshold (* 2 1024 1024)) ; decreasing the threshold to 2MB
|
||||||
|
|
||||||
(defvar my-config-file (expand-file-name "config.el" user-emacs-directory))
|
(defvar my-config-file (expand-file-name "config.el" user-emacs-directory))
|
||||||
(load my-config-file nil 'nomessage)
|
(load my-config-file nil 'nomessage)
|
||||||
|
|
||||||
(setq use-short-answer t)
|
(setq use-short-answer t)
|
||||||
(global-auto-revert-mode t)
|
(global-auto-revert-mode t)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
* Modules Selection module
|
* Modules Selection module
|
||||||
@ -164,14 +152,14 @@ Emacs Configuration for emacs 29.50
|
|||||||
`(variable-pitch ((t (:font "Ubuntu 14")))))))
|
`(variable-pitch ((t (:font "Ubuntu 14")))))))
|
||||||
|
|
||||||
(require 'custom-ui)
|
(require 'custom-ui)
|
||||||
;;(require 'custom-keybindings)
|
(require 'custom-keybindings)
|
||||||
;;(require 'custom-default)
|
(require 'custom-default)
|
||||||
;;(require 'custom-org)
|
(require 'custom-completion)
|
||||||
;;(require 'custom-completion)
|
(require 'custom-projects)
|
||||||
;;(require 'custom-projects)
|
(require 'custom-org)
|
||||||
;;(require 'custom-workspaces)
|
;;(require 'custom-workspaces)
|
||||||
;;(require 'custom-latex)
|
(require 'custom-latex)
|
||||||
;;(require 'custom-extra)
|
(require 'custom-extra)
|
||||||
|
|
||||||
;;; config.el ends here
|
;;; config.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -181,70 +169,54 @@ Emacs Configuration for emacs 29.50
|
|||||||
emacs built-in package config
|
emacs built-in package config
|
||||||
**** Eshell
|
**** Eshell
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-default.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-default.el
|
||||||
(use-package eshell
|
|
||||||
:defer t
|
|
||||||
:straight (:type built-in :build t)
|
|
||||||
:config
|
|
||||||
(setq eshell-prompt-function
|
(setq eshell-prompt-function
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(concat (abbreviate-file-name (eshell/pwd))
|
(concat (abbreviate-file-name (eshell/pwd))
|
||||||
(if (= (user-uid) 0) " # " " λ ")))
|
(if (= (user-uid) 0) " # " " λ ")))
|
||||||
eshell-prompt-regexp "^[^#λ\n]* [#λ] "))
|
eshell-prompt-regexp "^[^#λ\n]* [#λ] ")
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Dired
|
**** Dired
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-default.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-default.el
|
||||||
(use-package dired
|
(usr-package-install 'dired-single)
|
||||||
:straight (:type built-in)
|
(usr-package-install 'diredfl) ;; colorful dired
|
||||||
:ensure nil
|
(usr-package-install 'dired-git-info)
|
||||||
:commands (dired dired-jump)
|
(usr-package-install 'diff-hl) ;; diff highlight
|
||||||
:bind (("C-x C-j" . dired-jump))
|
(usr-package-install 'dired-rsync)
|
||||||
:custom ((dired-listing-switches "-agho --group-directories-first"))
|
(usr-package-install 'all-the-icons-dired)
|
||||||
:config
|
(usr-package-install 'dired-hide-dotfiles)
|
||||||
|
;; dired default
|
||||||
|
(setq dired-listing-switches "-agho --group-directories-first")
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
(evil-collection-define-key 'normal 'dired-mode-map
|
||||||
"h" 'dired-single-up-directory
|
"h" 'dired-single-up-directory
|
||||||
"l" 'dired-single-buffer))
|
"l" 'dired-single-buffer)
|
||||||
(autoload 'dired-omit-mode "dired-x")
|
(require 'dired-single)
|
||||||
(add-hook 'dired-load-hook
|
;;(use-package dired-single
|
||||||
(lambda ()
|
;; :commands (dired dired-jump))
|
||||||
(interactive)
|
;; colorful
|
||||||
(dired-hide-dotfiles--hide)))
|
(add-hook 'dired-mode-hook #'diredfl-mode)
|
||||||
;;;; to use h,l key
|
;; git info
|
||||||
(use-package dired-single
|
(evil-collection-define-key 'normal 'dired-mode-map
|
||||||
:commands (dired dired-jump))
|
")" 'dired-git-info-mode)
|
||||||
;;;; colorful dired
|
;; diff highlight
|
||||||
(use-package diredfl
|
(add-hook 'dired-mode-hook #'diff-hl-dired-mode-unless-remote)
|
||||||
:hook (dired-mode . diredfl-mode))
|
(add-hook 'magit-post-refresh-hook #'diff-hl-dired-mode-unless-remote)
|
||||||
;;;; from doom emacs
|
(diff-hl-margin-mode)
|
||||||
(defun +dired-enable-git-info-h ()
|
;; rsync
|
||||||
"Enable `dired-git-info-mode' in git repos."
|
(bind-key "C-c C-r" 'dired-rsync dired-mode-map)
|
||||||
(and (not (file-remote-p default-directory))
|
;; all-the icons
|
||||||
(locate-dominating-file "." ".git")
|
(add-hook 'dired-mode-hook #'all-the-icons-dired-mode)
|
||||||
(dired-git-info-mode 1)))
|
;; HACK:Fixes #1929: icons break file renaming in Emacs 27+, because the icon
|
||||||
(use-package dired-git-info)
|
|
||||||
(use-package diff-hl
|
|
||||||
:hook (dired-mode . diff-hl-dired-mode-unless-remote)
|
|
||||||
:hook (magit-post-refresh . diff-hl-magit-post-refresh)
|
|
||||||
:config
|
|
||||||
;; use margin instead of fringe
|
|
||||||
(diff-hl-margin-mode))
|
|
||||||
(use-package dired-rsync
|
|
||||||
:config
|
|
||||||
(bind-key "C-c C-r" 'dired-rsync dired-mode-map))
|
|
||||||
(use-package all-the-icons-dired
|
|
||||||
:hook (dired-mode . all-the-icons-dired-mode)
|
|
||||||
:config
|
|
||||||
;; HACK Fixes #1929: icons break file renaming in Emacs 27+, because the icon
|
|
||||||
;; is considered part of the filename, so we disable icons while we're in
|
;; is considered part of the filename, so we disable icons while we're in
|
||||||
;; wdired-mode.
|
;; wdired-mode.
|
||||||
;;(when EMACS27+
|
;;(when EMACS27+
|
||||||
(defvar +wdired-icons-enabled -1))
|
(defvar +wdired-icons-enabled -1)
|
||||||
(use-package dired-hide-dotfiles
|
|
||||||
:hook (dired-mode . dired-hide-dotfiles-mode)
|
|
||||||
:config
|
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
|
||||||
"H" 'dired-hide-dotfiles-mode))
|
|
||||||
|
|
||||||
;; TODO check emacs29 updates
|
;; hide dotfiles
|
||||||
|
(add-hook 'dired-mode-hook #'dired-hide-dotfiles-mode)
|
||||||
|
(evil-collection-define-key 'normal 'dired-mode-map
|
||||||
|
"H" 'dired-hide-dotfiles-mode)
|
||||||
|
|
||||||
|
;; TODO: check emacs29 updates
|
||||||
;;(csetq dired-mouse-drag-files t
|
;;(csetq dired-mouse-drag-files t
|
||||||
;; mouse-drag-and-drop-region-cross-program t)
|
;; mouse-drag-and-drop-region-cross-program t)
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -256,12 +228,26 @@ emacs built-in package config
|
|||||||
*** UI
|
*** UI
|
||||||
**** Install Packages
|
**** Install Packages
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
|
(usr-package-install 'all-the-icons)
|
||||||
(usr-package-install 'doom-themes)
|
(usr-package-install 'doom-themes)
|
||||||
(usr-package-install 'rainbow-delimiters)
|
(usr-package-install 'rainbow-delimiters)
|
||||||
(usr-package-install 'all-the-icons)
|
|
||||||
(usr-package-install 'doom-modeline)
|
(usr-package-install 'doom-modeline)
|
||||||
(usr-package-install 'visual-fill-column)
|
(usr-package-install 'visual-fill-column)
|
||||||
|
(usr-package-install 'dashboard)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
**** Line number
|
||||||
|
#+begin_src emacs-lisp :tangle ~/.config/emacs/init.el
|
||||||
|
(column-number-mode)
|
||||||
|
(global-display-line-numbers-mode t)
|
||||||
|
;; Disable line numbers for some modes
|
||||||
|
(dolist (mode '(org-mode-hook
|
||||||
|
nov-mode-hook
|
||||||
|
dashboard-mode-hook
|
||||||
|
dired-mode-hook
|
||||||
|
eshell-mode-hook))
|
||||||
|
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
**** Doom themes
|
**** Doom themes
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
(require 'doom-themes)
|
(require 'doom-themes)
|
||||||
@ -273,7 +259,7 @@ emacs built-in package config
|
|||||||
**** Rainbow Delimiters
|
**** Rainbow Delimiters
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
(require 'rainbow-delimiters)
|
(require 'rainbow-delimiters)
|
||||||
(add-hook 'prog-mode rainbow-delimiters-mode)
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Setting Transparency
|
**** Setting Transparency
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
@ -286,11 +272,11 @@ emacs built-in package config
|
|||||||
(if (eq (frame-parameter nil 'alpha-background) alpha-transparency)
|
(if (eq (frame-parameter nil 'alpha-background) alpha-transparency)
|
||||||
(set-frame-parameter nil 'alpha-background 0.9)
|
(set-frame-parameter nil 'alpha-background 0.9)
|
||||||
(set-frame-parameter nil 'alpha-background alpha-transparency))))
|
(set-frame-parameter nil 'alpha-background alpha-transparency))))
|
||||||
(defun my/transparency-round (val)
|
(defun my/transparency-round (val)
|
||||||
"Round VAL to the nearest tenth of an integer."
|
"Round VAL to the nearest tenth of an integer."
|
||||||
(/ (round (* 10 val)) 10.0))
|
(/ (round (* 10 val)) 10.0))
|
||||||
|
|
||||||
(defun my/increase-frame-alpha-background ()
|
(defun my/increase-frame-alpha-background ()
|
||||||
"Increase current frame’s alpha background."
|
"Increase current frame’s alpha background."
|
||||||
(interactive)
|
(interactive)
|
||||||
(set-frame-parameter nil
|
(set-frame-parameter nil
|
||||||
@ -300,7 +286,7 @@ emacs built-in package config
|
|||||||
(+ (frame-parameter nil 'alpha-background) 0.1))))
|
(+ (frame-parameter nil 'alpha-background) 0.1))))
|
||||||
(message "%s" (frame-parameter nil 'alpha-background)))
|
(message "%s" (frame-parameter nil 'alpha-background)))
|
||||||
|
|
||||||
(defun my/decrease-frame-alpha-background ()
|
(defun my/decrease-frame-alpha-background ()
|
||||||
"Decrease current frame’s alpha background."
|
"Decrease current frame’s alpha background."
|
||||||
(interactive)
|
(interactive)
|
||||||
(set-frame-parameter nil
|
(set-frame-parameter nil
|
||||||
@ -309,12 +295,11 @@ emacs built-in package config
|
|||||||
(max 0.0
|
(max 0.0
|
||||||
(- (frame-parameter nil 'alpha-background) 0.1))))
|
(- (frame-parameter nil 'alpha-background) 0.1))))
|
||||||
(message "%s" (frame-parameter nil 'alpha-background)))
|
(message "%s" (frame-parameter nil 'alpha-background)))
|
||||||
|
(global-set-key (kbd "C-c t") 'toggle-transparency)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Modeline
|
**** Modeline
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
(require 'doom-modeline)
|
(require 'doom-modeline)
|
||||||
|
|
||||||
(setq doom-modeline-height 15
|
(setq doom-modeline-height 15
|
||||||
doom-modeline-env-version t
|
doom-modeline-env-version t
|
||||||
doom-modeline-persp-name t
|
doom-modeline-persp-name t
|
||||||
@ -322,7 +307,7 @@ emacs built-in package config
|
|||||||
doom-modeline-display-default-persp-name t
|
doom-modeline-display-default-persp-name t
|
||||||
doom-modeline-indent-info t)
|
doom-modeline-indent-info t)
|
||||||
(doom-modeline-mode 1)
|
(doom-modeline-mode 1)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Whiteroom
|
**** Whiteroom
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
;;(use-package writeroom-mode
|
;;(use-package writeroom-mode
|
||||||
@ -342,47 +327,47 @@ emacs built-in package config
|
|||||||
(defun write-room-enable ()
|
(defun write-room-enable ()
|
||||||
(setq visual-fill-column-width 100
|
(setq visual-fill-column-width 100
|
||||||
visual-fill-column-center-text t)
|
visual-fill-column-center-text t)
|
||||||
(add-hook 'org-mode write-room-enable)
|
(visual-fill-column-mode 1))
|
||||||
(add-hook 'markdown-mode write-room-enable)
|
(add-hook 'org-mode-hook #'write-room-enable)
|
||||||
(add-hook 'nov-mode write-room-enable)
|
(add-hook 'markdown-mode-hook #'write-room-enable)
|
||||||
|
(add-hook 'nov-mode-hook #'write-room-enable)
|
||||||
(visual-fill-column-mode 1)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Dashboard
|
**** Dashboard
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-ui.el
|
||||||
;;; (use-package page-break-lines)
|
(require 'linum) ;; for dashboard seperator
|
||||||
;; (use-package dashboard
|
;;(add-hook 'dashboard-mode page-break-lines-mode)
|
||||||
;; :init ;; tweak dashboard config before loading it
|
(require 'dashboard)
|
||||||
;; (setq dashboard-projects-backend `project-el
|
|
||||||
;; dashboard-set-heading-icons t
|
(setq dashboard-set-heading-icons t)
|
||||||
;; dashboard-set-file-icons t
|
(setq dashboard-set-file-icons t)
|
||||||
;; dashboard-center-content t ;; set to 't' for centered content
|
;;(setq dashboard-banner-logo-title "Emacs is more than a text editor!")
|
||||||
;; dashboard-items '((recents . 10)
|
;;(setq dashboard-startup-banner 'logo)
|
||||||
;; (bookmarks . 5)
|
(setq dashboard-center-content t)
|
||||||
;; (projects . 10))
|
(setq dashboard-week-agenda t)
|
||||||
;; dashboard-set-footer t
|
(setq dashboard-agenda-time-string-format "%d/%m/%Y %A %H:%M")
|
||||||
;; dashboard-page-separator "\n\f\n"
|
(setq dashboard-items '((recents . 10)
|
||||||
;; dashboard-set-navigator t)
|
(agenda . 5)
|
||||||
;;
|
(bookmarks . 5)
|
||||||
;; (setq dashboard-startup-banner 'logo)
|
;;(projects . 5)
|
||||||
;; ;;(setq dashboard-startup-banner "~/.dotfiles/.config/emacs/logo3d.png")
|
(registers . 5)))
|
||||||
;; ;; Format: "(icon title help action face prefix suffix)"
|
(setq dashboard-set-navigator t)
|
||||||
;; (setq dashboard-navigator-buttons
|
|
||||||
;; `(;; line1
|
(setq dashboard-navigator-buttons
|
||||||
;; ((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
|
`(;; line1
|
||||||
;; "Github"
|
((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
|
||||||
; "Browse my Github"
|
"Github"
|
||||||
;; (lambda (&rest _) (browse-url "https://github.com/JaeUs3792/")))
|
"Browse my Github"
|
||||||
; (,(all-the-icons-octicon "home" :height 1.1 :v-adjust 0.0)
|
(lambda (&rest _) (browse-url "https://github.com/JaeUs3792/")))
|
||||||
; "Homepage"
|
(,(all-the-icons-octicon "home" :height 1.1 :v-adjust 0.0)
|
||||||
; "Browse my Homepage"
|
"Homepage"
|
||||||
; (lambda (&rest _) (browse-url "https://jaeus.net"))))))
|
"Browse my Homepage"
|
||||||
; :config
|
(lambda (&rest _) (browse-url "https://jaeus.net"))))))
|
||||||
; (dashboard-setup-startup-hook)
|
|
||||||
; (dashboard-modify-heading-icons '((recents . "file-text")
|
(dashboard-setup-startup-hook)
|
||||||
; (bookmarks . "book"))))
|
(dashboard-modify-heading-icons '((recents . "file-text")
|
||||||
; (setq doom-fallback-buffer-name "*dashboard*")
|
(bookmarks . "book")))
|
||||||
|
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -422,11 +407,19 @@ emacs built-in package config
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Key Bindings
|
*** Key Bindings
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
|
(usr-package-install 'which-key)
|
||||||
|
(usr-package-install 'general)
|
||||||
|
(usr-package-install 'evil)
|
||||||
|
(usr-package-install 'evil-collection)
|
||||||
|
(usr-package-install 'evil-nerd-commenter)
|
||||||
|
(usr-package-install 'evil-numbers)
|
||||||
|
;;(usr-package-install 'undo-tree)
|
||||||
|
(usr-package-install 'hydra)
|
||||||
|
#+end_src
|
||||||
**** Global Key
|
**** Global Key
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(global-set-key (kbd "C-c t") 'toggle-transparency)
|
|
||||||
;;(global-set-key (kbd "C-M-j") 'consult-buffer)
|
|
||||||
|
|
||||||
;; Make ESC quit prompts
|
;; Make ESC quit prompts
|
||||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||||
;; this annoying binding.
|
;; this annoying binding.
|
||||||
@ -437,26 +430,19 @@ emacs built-in package config
|
|||||||
**** Which keys
|
**** Which keys
|
||||||
When you begin a keybind, whichkey will show you all keybinds you can follow the first one with in order to form a full keywords.
|
When you begin a keybind, whichkey will show you all keybinds you can follow the first one with in order to form a full keywords.
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(use-package which-key
|
(require 'which-key)
|
||||||
:defer t
|
(setq which-key-idle-delay 0.5)
|
||||||
:init (which-key-mode)
|
|
||||||
:diminish which-key-mode
|
|
||||||
:config
|
|
||||||
(setq which-key-idle-delay 0.5))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** General
|
**** General
|
||||||
for managing keybindings.
|
for managing keybindings.
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(use-package general
|
(require 'general)
|
||||||
:init
|
|
||||||
(general-auto-unbind-keys)
|
(general-auto-unbind-keys)
|
||||||
:config
|
|
||||||
(general-evil-setup t)
|
(general-evil-setup t)
|
||||||
(general-create-definer ju/leader-key-def
|
(general-create-definer ju/leader-key-def
|
||||||
:keymaps '(normal insert visual emacs)
|
:keymaps '(normal insert visual emacs)
|
||||||
:prefix "SPC"
|
:prefix "SPC"
|
||||||
:global-prefix "C-SPC"))
|
:global-prefix "C-SPC")
|
||||||
|
|
||||||
(ju/leader-key-def
|
(ju/leader-key-def
|
||||||
"." 'find-file
|
"." 'find-file
|
||||||
;; Buffer
|
;; Buffer
|
||||||
@ -504,59 +490,59 @@ for managing keybindings.
|
|||||||
#+end_src
|
#+end_src
|
||||||
**** Evil Mode
|
**** Evil Mode
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(use-package evil
|
(customize-set-variable 'evil-want-integration t)
|
||||||
:after (general)
|
(customize-set-variable 'evil-want-keybinding nil)
|
||||||
:init
|
(customize-set-variable 'evil-want-C-u-scroll t)
|
||||||
(setq evil-want-integration t
|
(customize-set-variable 'evil-want-C-i-jump nil)
|
||||||
evil-want-keybinding nil
|
(customize-set-variable 'evil-respect-visual-line-mode nil) ; t : on the screen, nil : by cr characters
|
||||||
evil-want-C-u-scroll t
|
|
||||||
evil-want-C-i-jump nil)
|
(customize-set-variable 'evil-set-fine-undo t); more granular undo with evil
|
||||||
(require 'evil-vars)
|
|
||||||
(evil-set-undo-system 'undo-tree)
|
(require 'evil)
|
||||||
:config
|
|
||||||
(evil-mode 1)
|
(evil-mode 1)
|
||||||
(setq evil-want-fine-undo t) ; more granular undo with evil
|
;; Make evil search more like vim
|
||||||
|
;;(evil-select-search-module 'evil-search-module 'evil-search)
|
||||||
|
|
||||||
|
(evil-set-undo-system 'undo-redo)
|
||||||
(evil-set-initial-state 'messages-buffer-mode 'normal)
|
(evil-set-initial-state 'messages-buffer-mode 'normal)
|
||||||
(evil-set-initial-state 'dashboard-mode 'normal))
|
(evil-set-initial-state 'dashboard-mode 'normal)
|
||||||
(use-package evil-collection
|
|
||||||
:after evil
|
;; evil nerd commenter
|
||||||
:ensure t
|
|
||||||
:config
|
|
||||||
(evil-collection-init))
|
|
||||||
(use-package evil-nerd-commenter
|
|
||||||
:after evil
|
|
||||||
:config
|
|
||||||
(define-key evil-normal-state-map (kbd "g c") 'evilnc-comment-or-uncomment-lines)
|
(define-key evil-normal-state-map (kbd "g c") 'evilnc-comment-or-uncomment-lines)
|
||||||
(define-key evil-visual-state-map (kbd "g c") 'evilnc-comment-or-uncomment-lines))
|
(define-key evil-visual-state-map (kbd "g c") 'evilnc-comment-or-uncomment-lines)
|
||||||
(use-package evil-numbers
|
|
||||||
:after evil
|
;; evil collection
|
||||||
:config
|
(evil-collection-init)
|
||||||
|
|
||||||
|
;; evil numbers
|
||||||
;; unfortunately C-x is emacs common key binding.
|
;; unfortunately C-x is emacs common key binding.
|
||||||
(define-key evil-normal-state-map (kbd "g =") 'evil-numbers/inc-at-pt)
|
(define-key evil-normal-state-map (kbd "g =") 'evil-numbers/inc-at-pt)
|
||||||
(define-key evil-normal-state-map (kbd "g -") 'evil-numbers/dec-at-pt)
|
(define-key evil-normal-state-map (kbd "g -") 'evil-numbers/dec-at-pt)
|
||||||
(define-key evil-visual-state-map (kbd "g =") 'evil-numbers/inc-at-pt)
|
(define-key evil-visual-state-map (kbd "g =") 'evil-numbers/inc-at-pt)
|
||||||
(define-key evil-visual-state-map (kbd "g -") 'evil-numbers/dec-at-pt))
|
(define-key evil-visual-state-map (kbd "g -") 'evil-numbers/dec-at-pt)
|
||||||
|
|
||||||
|
;; eshell no evil
|
||||||
|
(dolist (mode '(eshell-mode))
|
||||||
|
(add-to-list 'evil-emacs-state-modes mode))
|
||||||
|
|
||||||
|
;; when programming _
|
||||||
(modify-syntax-entry ?_ "w")
|
(modify-syntax-entry ?_ "w")
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Undo Tree
|
**** Undo Tree
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(use-package undo-tree
|
;;(require 'undo-tree)
|
||||||
:init
|
;;(setq undo-tree-visualizer-diff t
|
||||||
(global-undo-tree-mode)
|
;; undo-tree-visualizer-timestamps t
|
||||||
(setq undo-tree-visualizer-diff t
|
;; undo-tree-auto-save-history t
|
||||||
undo-tree-visualizer-timestamps t)
|
;; undo-tree-enable-undo-in-region t
|
||||||
undo-tree-auto-save-history t
|
;; undo-limit (* 800 1024)
|
||||||
undo-tree-enable-undo-in-region t
|
;; undo-strong-limit (* 12 1024 1024)
|
||||||
undo-limit (* 800 1024)
|
;; undo-outer-limit (* 128 1024 1024))
|
||||||
undo-strong-limit (* 12 1024 1024)
|
;;(global-undo-tree-mode)
|
||||||
undo-outer-limit (* 128 1024 1024))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Hydra
|
**** Hydra
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-keybindings.el
|
||||||
(use-package hydra
|
(require 'hydra)
|
||||||
:defer t)
|
|
||||||
|
|
||||||
(defhydra hydra-text-scale (:timeout 4)
|
(defhydra hydra-text-scale (:timeout 4)
|
||||||
"scale text"
|
"scale text"
|
||||||
("t" text-scale-increase "in")
|
("t" text-scale-increase "in")
|
||||||
@ -583,150 +569,96 @@ for managing keybindings.
|
|||||||
*** Completion
|
*** Completion
|
||||||
config from crafted-emacs
|
config from crafted-emacs
|
||||||
https://github.com/SystemCrafter/crafted-emacs
|
https://github.com/SystemCrafter/crafted-emacs
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
|
(usr-package-install 'vertico)
|
||||||
|
(usr-package-install 'marginalia)
|
||||||
|
(usr-package-install 'consult)
|
||||||
|
(usr-package-install 'orderless)
|
||||||
|
(usr-package-install 'embark)
|
||||||
|
(usr-package-install 'embark-consult)
|
||||||
|
(usr-package-install 'corfu)
|
||||||
|
(usr-package-install 'corfu-terminal)
|
||||||
|
(usr-package-install 'cape)
|
||||||
|
#+end_src
|
||||||
**** Vertico
|
**** Vertico
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package vertico
|
(require 'vertico)
|
||||||
:ensure t
|
(require 'vertico-directory)
|
||||||
:bind (:map vertico-map
|
(with-eval-after-load 'evil
|
||||||
("C-j" . vertico-next)
|
(define-key vertico-map (kbd "C-j") 'vertico-next)
|
||||||
("C-k" . vertico-previous)
|
(define-key vertico-map (kbd "C-k") 'vertico-previous)
|
||||||
("M-h" . vertico-directory-up))
|
(define-key vertico-map (kbd "M-h") 'vertico-directory-up))
|
||||||
:custom
|
(customize-set-variable 'vertico-cycle t)
|
||||||
(vertico-cycle t)
|
(vertico-mode 1)
|
||||||
:init
|
|
||||||
(vertico-mode))
|
|
||||||
;;(use-package vertico-posframe
|
|
||||||
;;:disabled
|
|
||||||
;;:after vertico
|
|
||||||
;;:ensure t
|
|
||||||
;;:init
|
|
||||||
;;(setq vertico-posframe-parameters
|
|
||||||
;;`((left-fringe . 8)
|
|
||||||
;;(right-fringe . 8) (alpha . 100)))
|
|
||||||
;;(vertico-posframe-mode 1))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Marginalia
|
**** Marginalia
|
||||||
annotations placed at the margin of the minibuffer
|
annotations placed at the margin of the minibuffer
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package marginalia
|
(require 'marginalia)
|
||||||
:after vertico
|
(customize-set-variable 'marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
||||||
:ensure t
|
(marginalia-mode 1)
|
||||||
:custom
|
|
||||||
(marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
|
||||||
:init
|
|
||||||
(marginalia-mode))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Consult
|
**** Consult
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package consult
|
(global-set-key (kbd "C-s") 'consult-line)
|
||||||
:demand t
|
(define-key minibuffer-local-map (kbd "C-r") 'consult-history)
|
||||||
:bind (("C-s" . consult-line)
|
(global-set-key (kbd "C-M-j") 'consult-buffer)
|
||||||
:map minibuffer-local-map
|
(setq completion-in-region-function #'consult-completion-in-region)
|
||||||
("C-r" . consult-history))
|
|
||||||
:custom
|
|
||||||
(completion-in-region-function #'consult-completion-in-region))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Orderless
|
**** Orderless
|
||||||
orderless completion
|
orderless completion
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package orderless
|
(require 'orderless)
|
||||||
:ensure t
|
(customize-set-variable 'completion-styles '(orderless basic))
|
||||||
:custom
|
(customize-set-variable 'completion-category-overrides '((file (style basic partial-completion))))
|
||||||
(completion-styles '(orderless basic))
|
|
||||||
(completion-category-overrides '((file (style basic partial-completion)))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Embark
|
**** Embark / Embark Consult
|
||||||
Quick Action in minibuffer
|
Quick Action in minibuffer
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package embark
|
(require 'embark)
|
||||||
:ensure t
|
(require 'embark-consult)
|
||||||
:bind (("C-." . embark-act)
|
(global-set-key [remap describe-bindings] #'embark-bindings)
|
||||||
("C-;" . embark-dwim)
|
(global-set-key (kbd "C-.") 'embark-act)
|
||||||
("C-h B" . embark-bindings))
|
;; Use Embark to show bindings in a key prefix with `C-h`
|
||||||
:init
|
|
||||||
;; Optionally replace the key help with a completing-read interface
|
|
||||||
(setq prefix-help-command #'embark-prefix-help-command)
|
(setq prefix-help-command #'embark-prefix-help-command)
|
||||||
|
(with-eval-after-load 'embark-consult
|
||||||
:config
|
(add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
|
||||||
|
|
||||||
;; Hide the mode line of the Embark live/completions buffers
|
|
||||||
(add-to-list 'display-buffer-alist
|
|
||||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
|
||||||
nil
|
|
||||||
(window-parameters (mode-line-format . none)))))
|
|
||||||
(use-package embark-consult
|
|
||||||
:ensure t
|
|
||||||
:after (embark consult)
|
|
||||||
:demand t ; only necessary if you have the hook below
|
|
||||||
;; if you want to have consult previews as you move around an
|
|
||||||
;; auto-updating embark collect buffer
|
|
||||||
:hook
|
|
||||||
(embark-collect-mode . consult-preview-at-point-mode))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Corfu
|
**** Corfu / Cape
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(use-package corfu)
|
;;; Corfu
|
||||||
(use-package popon
|
|
||||||
:defer t
|
|
||||||
:straight (popon :build t
|
|
||||||
:type git
|
|
||||||
:host nil
|
|
||||||
:repo "https://codeberg.org/akib/emacs-popon.git"))
|
|
||||||
(use-package confu-terminal
|
|
||||||
:defer t
|
|
||||||
:straight (confu-terminal :build t
|
|
||||||
:type git
|
|
||||||
:host nil
|
|
||||||
:repo "https://codeberg.org/akib/emacs-corfu-terminal.git"))
|
|
||||||
(add-to-list 'load-path
|
|
||||||
(expand-file-name "straight/build/corfu/extensions"
|
|
||||||
user-emacs-directory))
|
|
||||||
(require 'corfu-popupinfo)
|
(require 'corfu-popupinfo)
|
||||||
(require 'corfu)
|
(require 'corfu)
|
||||||
|
|
||||||
(unless (display-graphic-p)
|
(unless (display-graphic-p)
|
||||||
(require 'corfu-terminal)
|
(require 'corfu-terminal)
|
||||||
(corfu-terminal-mode +1))
|
(corfu-terminal-mode +1))
|
||||||
|
|
||||||
(customize-set-variable 'corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
|
;; Setup corfu for popup like completion
|
||||||
(customize-set-variable 'corfu-auto t) ;; Enable auto completion
|
(customize-set-variable 'corfu-cycle t) ; Allows cycling through candidates
|
||||||
(customize-set-variable 'corfu-auto-prefix 2)
|
(customize-set-variable 'corfu-auto t) ; Enable auto completion
|
||||||
(customize-set-variable 'corfu-auto-delay 0.0)
|
(customize-set-variable 'corfu-auto-prefix 2) ; Complete with less prefix keys
|
||||||
;; (customize-set-variable 'corfu-separator ?\s) ;; Orderless field separator
|
(customize-set-variable 'corfu-auto-delay 0.0) ; No delay for completion
|
||||||
;; (customize-set-variable 'corfu-quit-at-boundary nil) ;; Never quit at completion boundary
|
(customize-set-variable 'corfu-echo-documentation 0.25) ; Echo docs for current completion option
|
||||||
;; (customize-set-variable 'corfu-quit-no-match nil) ;; Never quit, even if there is no match
|
|
||||||
;; (customize-set-variable 'corfu-preview-current nil) ;; Disable current candidate preview
|
|
||||||
;; (customize-set-variable 'corfu-preselect 'prompt) ;; Preselect the prompt
|
|
||||||
;; (customize-set-variable 'corfu-on-exact-match nil) ;; Configure handling of exact matches
|
|
||||||
;; (customize-set-variable 'corfu-scroll-margin 5) ;; Use scroll margin
|
|
||||||
(customize-set-variable 'corfu-echo-documentation 0.25)
|
|
||||||
(global-corfu-mode 1)
|
(global-corfu-mode 1)
|
||||||
(corfu-popupinfo-mode 1)
|
(corfu-popupinfo-mode 1)
|
||||||
(eldoc-add-command #'corfu-insert)
|
(eldoc-add-command #'corfu-insert)
|
||||||
(define-key corfu-map (kbd "M-p") #'corfu-popupinfo-scroll-down)
|
(define-key corfu-map (kbd "M-p") #'corfu-popupinfo-scroll-down)
|
||||||
(define-key corfu-map (kbd "M-n") #'corfu-popupinfo-scroll-up)
|
(define-key corfu-map (kbd "M-n") #'corfu-popupinfo-scroll-up)
|
||||||
(define-key corfu-map (kbd "M-d") #'corfu-popupinfo-toggle)
|
(define-key corfu-map (kbd "M-d") #'corfu-popupinfo-toggle)
|
||||||
#+end_src
|
|
||||||
|
|
||||||
**** Cape
|
;;; Cape
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
|
||||||
(use-package cape
|
;; Setup Cape for better completion-at-point support and more
|
||||||
:init
|
(require 'cape)
|
||||||
;; Add `completion-at-point-functions', used by `completion-at-point'.
|
|
||||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
;; Add useful defaults completion sources from cape
|
||||||
(add-to-list 'completion-at-point-functions #'cape-file)
|
(add-to-list 'completion-at-point-functions #'cape-file)
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-history)
|
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-keyword)
|
|
||||||
(add-to-list 'completion-at-point-functions #'cape-tex)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-sgml)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-rfc1345)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-abbrev)
|
|
||||||
(add-to-list 'completion-at-point-functions #'cape-ispell)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-dict)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-symbol)
|
|
||||||
;;(add-to-list 'completion-at-point-functions #'cape-line)
|
|
||||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
|
||||||
;; Silence the pcomplete capf, no errors or messages!
|
;; Silence the pcomplete capf, no errors or messages!
|
||||||
;; Important for corfu
|
;; Important for corfu
|
||||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
||||||
@ -734,37 +666,34 @@ Quick Action in minibuffer
|
|||||||
;; Ensure that pcomplete does not write to the buffer
|
;; Ensure that pcomplete does not write to the buffer
|
||||||
;; and behaves as a pure `completion-at-point-function'.
|
;; and behaves as a pure `completion-at-point-function'.
|
||||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)
|
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)
|
||||||
)
|
|
||||||
(add-hook 'eshell-mode-hook
|
(add-hook 'eshell-mode-hook
|
||||||
(lambda () (setq-local corfu-quit-at-boundary t
|
(lambda () (setq-local corfu-quit-at-boundary t
|
||||||
corfu-quit-no-match t
|
corfu-quit-no-match t
|
||||||
corfu-auto nil)
|
corfu-auto nil)
|
||||||
(corfu-mode)))
|
(corfu-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
**** Provide Modules
|
**** Provide Modules
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
(provide 'custom-completion)
|
(provide 'custom-completion)
|
||||||
;;; custom-completion.el ends here
|
;;; custom-completion.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Org Mode
|
*** Org Mode
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
|
(usr-package-install 'valign)
|
||||||
|
(usr-package-install 'org-pdftools)
|
||||||
|
#+end_src
|
||||||
**** Valign
|
**** Valign
|
||||||
| 12345678 | |
|
| 12345678 | |
|
||||||
|----------+---|
|
|----------+---|
|
||||||
| 일이삼사 | |
|
| 일이삼사 | |
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
(use-package valign
|
(customize-set-variable 'valign-fancy-bar t)
|
||||||
:defer t
|
|
||||||
:after (org markdown-mode)
|
|
||||||
;; :hook ((org-mode markdown-mode) . valign-mode)
|
|
||||||
:custom ((valign-fancy-bar t)))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Org PDF tools
|
**** Org PDF tools
|
||||||
get link from pdf,
|
get link from pdf,
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
(use-package org-pdftools
|
(add-hook 'org-mode-hook #'org-pdftools-setup-link)
|
||||||
:hook (org-mode . org-pdftools-setup-link))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Provide Modules
|
**** Provide Modules
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
@ -772,28 +701,33 @@ get link from pdf,
|
|||||||
;;; custom-org.el ends here
|
;;; custom-org.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Projects
|
*** Projects
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
||||||
|
(usr-package-install 'magit)
|
||||||
|
(usr-package-install 'magit-todos)
|
||||||
|
;;(usr-package-install 'forge)
|
||||||
|
(usr-package-install 'hl-todo)
|
||||||
|
#+end_src
|
||||||
**** MAGIT
|
**** MAGIT
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
||||||
(use-package magit)
|
;;(use-package magit)
|
||||||
;;:commands (magit-status magit-get-current-branch)
|
(require 'magit)
|
||||||
;;:custom
|
;;(magit-status magit-get-current-branch)
|
||||||
;;(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
;; ;;:custom
|
||||||
(use-package magit-todos
|
(setq magit-clone-default-directory "~/Project/"
|
||||||
:after (magit todo)
|
magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
||||||
:config
|
;;(use-package magit-todos
|
||||||
(setq magit-todos-ignore-case t))
|
;; :after (magit todo)
|
||||||
(use-package forge
|
;; :config
|
||||||
:after magit)
|
;; (setq magit-todos-ignore-case t))
|
||||||
|
;;(use-package forge
|
||||||
|
;; :after magit)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Highlight TODOs
|
**** Highlight TODOs
|
||||||
|
***** TODO: test
|
||||||
***** TODO test
|
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
||||||
(use-package hl-todo
|
(require 'hl-todo)
|
||||||
:hook (prog-mode . hl-todo-mode)
|
(setq hl-todo-keyword-faces
|
||||||
:config
|
|
||||||
(setq hl-todo-highlight-punctuation ":"
|
|
||||||
hl-todo-keyword-faces
|
|
||||||
`(;; For things that need to be done, just not today.
|
`(;; For things that need to be done, just not today.
|
||||||
("TODO" warning bold)
|
("TODO" warning bold)
|
||||||
;; For problems that will become bigger problems later if not
|
;; For problems that will become bigger problems later if not
|
||||||
@ -813,7 +747,13 @@ get link from pdf,
|
|||||||
;; For a known bug that needs a workaround
|
;; For a known bug that needs a workaround
|
||||||
("BUG" error bold)
|
("BUG" error bold)
|
||||||
;; For warning about a problematic or misguiding code
|
;; For warning about a problematic or misguiding code
|
||||||
("XXX" font-lock-constant-face bold))))
|
("XXX" font-lock-constant-face bold)))
|
||||||
|
(global-hl-todo-mode 1)
|
||||||
|
#+end_src
|
||||||
|
**** Magit TODOs
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
||||||
|
(require 'magit-todos)
|
||||||
|
(add-hook 'magit-mode-hook #'magit-todos-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Provide Modules
|
**** Provide Modules
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-projects.el
|
||||||
@ -865,102 +805,111 @@ get link from pdf,
|
|||||||
;;; custom-workspaces.el ends here
|
;;; custom-workspaces.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Latex
|
*** Latex
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
||||||
|
(usr-package-install 'auctex)
|
||||||
|
(usr-package-install 'cdlatex)
|
||||||
|
(usr-package-install 'latex-preview-pane)
|
||||||
|
#+end_src
|
||||||
**** AUCTEX
|
**** AUCTEX
|
||||||
writing and formatting tex file in Emacs.
|
writing and formatting tex file in Emacs.
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
||||||
(use-package auctex
|
(with-eval-after-load 'latex
|
||||||
:defer t
|
(customize-set-variable 'TeX-auto-save t)
|
||||||
:init
|
(customize-set-variable 'TeX-parse-self t)
|
||||||
(setq TeX-command-default (if (executable-find "latexmk") "LatexMk" "LaTeX")
|
(setq-default TeX-master nil)
|
||||||
TeX-engine (if (executable-find "xetex") 'xetex 'default)
|
|
||||||
TeX-auto-save t
|
;; compile to pdf
|
||||||
TeX-parse-self t
|
(tex-pdf-mode)
|
||||||
TeX-syntactic-comment t
|
|
||||||
TeX-auto-local ".auctex-auto"
|
;; correlate the source and the output
|
||||||
TeX-style-local ".auctex-style"
|
(TeX-source-correlate-mode)
|
||||||
TeX-source-correlate-mode t
|
|
||||||
TeX-source-correlate-method 'synctex
|
;; set a correct indentation in a few additional environments
|
||||||
TeX-source-correlate-start-server nil
|
(add-to-list 'LaTeX-indent-environment-list '("lstlisting" current-indentation))
|
||||||
TeX-electric-sub-and-superscript t
|
(add-to-list 'LaTeX-indent-environment-list '("tikzcd" LaTeX-indent-tabular))
|
||||||
TeX-fill-break-at-separators nil
|
(add-to-list 'LaTeX-indent-environment-list '("tikzpicture" current-indentation))
|
||||||
TeX-save-query t)
|
|
||||||
:config
|
;; add a few macros and environment as verbatim
|
||||||
(setq TeX-master t)
|
(add-to-list 'LaTeX-verbatim-environments "lstlisting")
|
||||||
(setcar (cdr (assoc "Check" TeX-command-list)) "chktex -v6 -H %s")
|
(add-to-list 'LaTeX-verbatim-environments "Verbatim")
|
||||||
(add-hook 'TeX-mode-hook (lambda ()
|
(add-to-list 'LaTeX-verbatim-macros-with-braces "lstinline")
|
||||||
(setq ispell-parser 'tex
|
(add-to-list 'LaTeX-verbatim-macros-with-delims "lstinline")
|
||||||
fill-nobreak-predicate (cons #'texmathp fill-nobreak-predicate))))
|
|
||||||
(add-hook 'TeX-mode-hook #'visual-line-mode)
|
;; to use pdfview with auctex
|
||||||
(add-hook 'TeX-update-style-hook #'rainbow-delimiters-mode))
|
(customize-set-variable 'TeX-view-program-selection '((output-pdf "PDF Tools")))
|
||||||
|
(customize-set-variable 'TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)))
|
||||||
|
(customize-set-variable 'TeX-source-correlate-start-server t)
|
||||||
|
|
||||||
|
;; electric pairs in auctex
|
||||||
|
(customize-set-variable 'TeX-electric-sub-and-superscript t)
|
||||||
|
(customize-set-variable 'LaTeX-electric-left-right-brace t)
|
||||||
|
(customize-set-variable 'TeX-electric-math (cons "$" "$"))
|
||||||
|
|
||||||
|
;; open all buffers with the math mode and auto-fill mode
|
||||||
|
(add-hook 'LaTeX-mode-hook #'auto-fill-mode)
|
||||||
|
(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)
|
||||||
|
|
||||||
|
;; add support for references
|
||||||
|
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
|
||||||
|
(customize-set-variable 'reftex-plug-into-AUCTeX t)
|
||||||
|
|
||||||
|
;; to have the buffer refresh after compilation
|
||||||
|
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer))
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Cdlatex
|
**** Cdlatex
|
||||||
speed-up insertion of environments and math templates.
|
speed-up insertion of environments and math templates.
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
||||||
(use-package cdlatex
|
(add-hook 'org-mode-hook #'org-cdlatex-mode)
|
||||||
:defer t
|
(add-hook 'LaTeX-mode-hook #'cdlatex-mode)
|
||||||
:after auctex
|
|
||||||
:hook (LaTeX-mode . cdlatex-mode)
|
|
||||||
:hook (org-mode . org-cdlatex-mode)
|
|
||||||
:config
|
|
||||||
(setq cdlatex-use-dollar-to-ensure-math nil)
|
(setq cdlatex-use-dollar-to-ensure-math nil)
|
||||||
:general
|
|
||||||
(phundrak/major-leader-key
|
|
||||||
:packages 'cdlatex
|
|
||||||
:keymaps 'cdlatex-mode-map
|
|
||||||
"$" nil
|
|
||||||
"(" nil
|
|
||||||
"{" nil
|
|
||||||
"[" nil
|
|
||||||
"|" nil
|
|
||||||
"<" nil
|
|
||||||
"^" nil
|
|
||||||
"_" nil
|
|
||||||
[(control return)] nil))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Preview pane
|
**** Preview pane
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
||||||
(use-package latex-preview-pane)
|
(require 'latex-preview-pane)
|
||||||
|
;;(use-package latex-preview-pane)
|
||||||
#+end_src
|
#+end_src
|
||||||
** TODO gddg
|
|
||||||
**** Provide Modules
|
**** Provide Modules
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-latex.el
|
||||||
(provide 'custom-latex)
|
(provide 'custom-latex)
|
||||||
;;; custom-latex.el ends here
|
;;; custom-latex.el ends here
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Extra
|
*** Extra
|
||||||
|
**** Install Packages
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
|
(usr-package-install 'helpful)
|
||||||
|
(usr-package-install 'pdf-tools)
|
||||||
|
(usr-package-install 'pdf-view-restore)
|
||||||
|
(usr-package-install 'nov)
|
||||||
|
#+end_src
|
||||||
**** Helpful
|
**** Helpful
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
(use-package helpful
|
(customize-set-variable 'counsel-describe-function-function #'helpful-callable)
|
||||||
:commands (helpful-callable helpful-variable helpful-command helpful-key)
|
(customize-set-variable 'counsel-describe-variable-function #'helpful-variable)
|
||||||
:custom
|
(require 'helpful)
|
||||||
(counsel-describe-function-function #'helpful-callable)
|
;;:commands (helpful-callable helpful-variable helpful-command helpful-key)
|
||||||
(counsel-describe-variable-function #'helpful-variable)
|
(global-set-key [remap describe-function] #'describe-function)
|
||||||
:bind
|
(global-set-key [remap describe-command] #'helpful-command)
|
||||||
([remap describe-function] . describe-function)
|
(global-set-key [remap describe-variable] #'describe-variable)
|
||||||
([remap describe-command] . helpful-command)
|
(global-set-key [remap describe-key] #'helpful-key)
|
||||||
([remap describe-variable] . describe-variable)
|
|
||||||
([remap describe-key] . helpful-key))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** PDF Tool
|
**** PDF Tool
|
||||||
enhanced PDF viewer on emacs
|
enhanced PDF viewer on emacs
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
(use-package pdf-tools)
|
(require 'pdf-tools)
|
||||||
|
(pdf-tools-install)
|
||||||
|
(setq-default pdf-view-display-size 'fit-width)
|
||||||
#+end_src
|
#+end_src
|
||||||
**** PDF view restore
|
**** PDF view restore
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
(use-package pdf-view-restore
|
(add-hook 'pdf-view-mode-hook #'pdf-view-restore-mode)
|
||||||
:after pdf-tools
|
|
||||||
:defer t
|
|
||||||
:hook (pdf-view-mode . pdf-view-restore-mode)
|
|
||||||
:config
|
|
||||||
(setq pdf-view-restore-filename (expand-file-name ".tmp/pdf-view-restore"
|
(setq pdf-view-restore-filename (expand-file-name ".tmp/pdf-view-restore"
|
||||||
user-emacs-directory)))
|
user-emacs-directory))
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Nov
|
**** Nov
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
(use-package nov
|
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
|
||||||
:mode ("\\.epub\\'" . nov-mode))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
**** Provide Modules
|
**** Provide Modules
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-extra.el
|
||||||
|
|||||||
Reference in New Issue
Block a user