mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-14 08:01:35 +09:00
Emacs : back to vanilla with 28.1 emacs version
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
(("default" . ((user-emacs-directory . "~/.emacs.rational")
|
(("default" . ((user-emacs-directory . "~/.emacs.df")))
|
||||||
(env . (("RATIONAL_EMACS_HOME" . "~/.emacs.rational.d")))))
|
|
||||||
("vanilla" . ((user-emacs-directory . "~/.emacs.vanilla")))
|
("vanilla" . ((user-emacs-directory . "~/.emacs.vanilla")))
|
||||||
("doom" . ((user-emacs-directory . "~/.emacs.doom")
|
("doom" . ((user-emacs-directory . "~/.emacs.doom")
|
||||||
(env . (("DOOMDIR" . "~/.emacs.doom.d")))))
|
(env . (("DOOMDIR" . "~/.emacs.doom.d")))))
|
||||||
|
|||||||
2
.emacs.df/.gitignore
vendored
Normal file
2
.emacs.df/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/.emacs.df/emojis/
|
||||||
|
/.emacs.df/forge-database.sqlite
|
||||||
46
.emacs.df/early-init.el
Normal file
46
.emacs.df/early-init.el
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
;;; early-init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Increase the GC threshold for faster startup
|
||||||
|
;; The default is 800 kilobytes. Measured in bytes.
|
||||||
|
(setq gc-cons-threshold (* 50 1000 1000))
|
||||||
|
|
||||||
|
;; Prefer loading newest compiled .el file
|
||||||
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
|
;; Native compilation settings
|
||||||
|
(when (featurep 'native-compile)
|
||||||
|
;; Silence compiler warnings as they can be pretty disruptive
|
||||||
|
(setq native-comp-async-report-warnings-errors nil)
|
||||||
|
|
||||||
|
;; Make native compilation happens asynchronously
|
||||||
|
(setq native-comp-deferred-compilation t)
|
||||||
|
|
||||||
|
;; Set the right directory to store the native compilation cache
|
||||||
|
;; NOTE the method for setting the eln-cache directory depends on the emacs version
|
||||||
|
(when (fboundp 'startup-redirect-eln-cache)
|
||||||
|
(if (version< emacs-version "29")
|
||||||
|
(add-to-list 'native-comp-eln-load-path (convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory)))
|
||||||
|
(startup-redirect-eln-cache (convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory)))))
|
||||||
|
|
||||||
|
(add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory)))
|
||||||
|
|
||||||
|
;; Don't use package.el, we'll use straight.el instead
|
||||||
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
|
;; Remove some unneeded UI elements (the user can turn back on anything they wish)
|
||||||
|
(setq inhibit-startup-message t)
|
||||||
|
(push '(tool-bar-lines . 0) default-frame-alist)
|
||||||
|
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||||
|
(push '(vertical-scroll-bars) default-frame-alist)
|
||||||
|
(push '(mouse-color . "white") default-frame-alist)
|
||||||
|
|
||||||
|
;; Loads a nice blue theme, avoids the white screen flash on startup.
|
||||||
|
(load-theme 'deeper-blue t)
|
||||||
|
|
||||||
|
;; Make the initial buffer load faster by setting its mode to fundamental-mode
|
||||||
|
(setq initial-major-mode 'fundamental-mode)
|
||||||
|
|
||||||
|
;; Load the early config file if it exists
|
||||||
|
(let ((early-config-path (expand-file-name "~/.emacs.df/early-config.el")))
|
||||||
|
(when (file-exists-p early-config-path)
|
||||||
|
(load early-config-path nil 'nomessage)))
|
||||||
6
.emacs.df/exwm/.start-exwm.sh.~undo-tree~
Normal file
6
.emacs.df/exwm/.start-exwm.sh.~undo-tree~
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
(undo-tree-save-format-version . 1)
|
||||||
|
"e976d2036366e62bb8915b7138e0b4a5fb4918fa"
|
||||||
|
[nil nil nil nil (25145 39387 666368 202000) 0 nil]
|
||||||
|
([nil nil ((445 . 454) (t 25145 11614 471859 40000)) nil (25145 39387 666364 698000) 0 nil])
|
||||||
|
([nil current ((408 . 416) (#("vanilla" 0 7 (fontified t)) . 408) (undo-tree-id0 . -7) (undo-tree-id1 . -7) (undo-tree-id2 . -7) (undo-tree-id3 . -7) (undo-tree-id4 . -7) (undo-tree-id5 . -6) (undo-tree-id6 . -6) (undo-tree-id7 . -6) (undo-tree-id8 . -6) (undo-tree-id9 . -6) (undo-tree-id10 . -5) (undo-tree-id11 . -5) (undo-tree-id12 . -5) (undo-tree-id13 . -5) (undo-tree-id14 . -5) (undo-tree-id15 . -5) (undo-tree-id16 . -5) (undo-tree-id17 . -5) (undo-tree-id18 . -5) (undo-tree-id19 . -5) (undo-tree-id20 . -6) (undo-tree-id21 . -6) (undo-tree-id22 . -6) (undo-tree-id23 . -6) (undo-tree-id24 . -6) (undo-tree-id25 . -6) (undo-tree-id26 . -6) (undo-tree-id27 . -6) (undo-tree-id28 . -6) (undo-tree-id29 . -6) (undo-tree-id30 . -7) (undo-tree-id31 . -7) (undo-tree-id32 . -7) (undo-tree-id33 . -7) (undo-tree-id34 . -7) (undo-tree-id35 . -7) (undo-tree-id36 . -7) (undo-tree-id37 . -7) (undo-tree-id38 . -7) (undo-tree-id39 . -7) (undo-tree-id40 . -7) (undo-tree-id41 . -7) (undo-tree-id42 . -7) (undo-tree-id43 . -7) (undo-tree-id44 . -7) (undo-tree-id45 . -7) (undo-tree-id46 . -7) (undo-tree-id47 . -6) (undo-tree-id48 . -6) (undo-tree-id49 . -6) (undo-tree-id50 . -6) (undo-tree-id51 . -6) (undo-tree-id52 . -6) (undo-tree-id53 . -6) (undo-tree-id54 . -6) (undo-tree-id55 . -6) (undo-tree-id56 . -6) (undo-tree-id57 . -6) (undo-tree-id58 . -6) (undo-tree-id59 . -6) (undo-tree-id60 . -6) (undo-tree-id61 . -6) (undo-tree-id62 . -5) (undo-tree-id63 . -5) (undo-tree-id64 . -5) (undo-tree-id65 . -5) (undo-tree-id66 . -5) (undo-tree-id67 . -4) (undo-tree-id68 . -4) (undo-tree-id69 . -4) (undo-tree-id70 . -4) (undo-tree-id71 . -4) (undo-tree-id72 . -3) (undo-tree-id73 . -3) (undo-tree-id74 . -3) (undo-tree-id75 . -3) (undo-tree-id76 . -3) (undo-tree-id77 . -2) (undo-tree-id78 . -2) (undo-tree-id79 . -2) (undo-tree-id80 . -2) (undo-tree-id81 . -2) (undo-tree-id82 . -1) (undo-tree-id83 . -1) (undo-tree-id84 . -1) (undo-tree-id85 . -1) (undo-tree-id86 . -1) (undo-tree-id87 . -1) (undo-tree-id88 . -1) (undo-tree-id89 . -1) (undo-tree-id90 . -1) (undo-tree-id91 . -1) (t 25145 39387 681489 213000)) nil (25145 39399 354371 746000) 0 nil])
|
||||||
|
nil
|
||||||
8
.emacs.df/exwm/EXWM.desktop
Normal file
8
.emacs.df/exwm/EXWM.desktop
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=EXWM
|
||||||
|
Comment=Emacs Window Manager
|
||||||
|
Exec=sh /home/jaeus/.emacs.rational.d/exwm/start-exwm.sh
|
||||||
|
TryExec=sh
|
||||||
|
Type=Application
|
||||||
|
X-LightDM-DesktopName=exwm
|
||||||
|
DesktopNames=exwm
|
||||||
13
.emacs.df/exwm/start-exwm.sh
Executable file
13
.emacs.df/exwm/start-exwm.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Set the screen DPI (uncomment this if needed!)
|
||||||
|
# xrdb ~/.emacs.d/exwm/Xresources
|
||||||
|
|
||||||
|
# Run the screen compositor
|
||||||
|
#picom &
|
||||||
|
#picom -b --config /home/jaeus/.config/i3/picom.conf &
|
||||||
|
# Enable screen locking on suspend
|
||||||
|
#xss-lock -- slock &
|
||||||
|
|
||||||
|
picom -b --config $HOME/.xmonad/scripts/picom.conf &
|
||||||
|
~/scripts/random_wallpaper.sh
|
||||||
|
exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.emacs.rational.d/desktop.el
|
||||||
967
.emacs.df/init.el
Normal file
967
.emacs.df/init.el
Normal file
@ -0,0 +1,967 @@
|
|||||||
|
;;; init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Profile emacs startup
|
||||||
|
(add-hook 'emacs-startup-hook
|
||||||
|
(lambda ()
|
||||||
|
(message "Emacs loaded in %s."
|
||||||
|
(emacs-init-time))))
|
||||||
|
|
||||||
|
;; Set default coding system (especially for Windows)
|
||||||
|
(set-language-environment "korean")
|
||||||
|
(set-default-coding-systems 'utf-8)
|
||||||
|
(prefer-coding-system 'utf-8)
|
||||||
|
(customize-set-variable 'visible-bell 1) ; turn off beeps, make them flash!
|
||||||
|
(customize-set-variable 'large-file-warning-threshold 100000000) ;; change to ~100 MB
|
||||||
|
;; backup in one place. flat, no tree structure
|
||||||
|
(setq backup-directory-alist '(("." . "~/.emacs.df/backups")))
|
||||||
|
(customize-set-variable
|
||||||
|
'tramp-backup-directory-alist backup-directory-alist)
|
||||||
|
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.df/undo")))
|
||||||
|
|
||||||
|
;; straight.el
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
|
(bootstrap-version 5))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
(setq straight-use-package-by-default t)
|
||||||
|
(straight-use-package 'use-package)
|
||||||
|
|
||||||
|
|
||||||
|
(defvar user-config-etc-directory (expand-file-name "etc/" user-emacs-directory)
|
||||||
|
"The user's configuration etc/ folder.")
|
||||||
|
(defvar user-config-var-directory (expand-file-name "var/" user-emacs-directory)
|
||||||
|
"The user's configuration var/ folder.")
|
||||||
|
|
||||||
|
(mkdir user-config-etc-directory t)
|
||||||
|
(mkdir user-config-var-directory t)
|
||||||
|
|
||||||
|
;; Make GC pauses faster by decreasing the threshold.
|
||||||
|
|
||||||
|
(use-package gcmh
|
||||||
|
:config
|
||||||
|
(gcmh-mode 1))
|
||||||
|
(setq gc-cons-threshold (* 2 1000 1000))
|
||||||
|
|
||||||
|
;; follow symboliclinks
|
||||||
|
(setq vc-follow-symlinks t)
|
||||||
|
|
||||||
|
;; configuration
|
||||||
|
(setq user-full-name "JaeYoo,Im"
|
||||||
|
user-mail-address "cpu3792@gmail.com")
|
||||||
|
|
||||||
|
(defvar gvar/default-font-size 110)
|
||||||
|
(defvar gvar/default-variable-font-size 110)
|
||||||
|
(defvar gvar/frame-transparency '(85 . 85))
|
||||||
|
|
||||||
|
;; Set further font and theme customizations
|
||||||
|
(custom-set-variables
|
||||||
|
'(rational-ui-default-font
|
||||||
|
'(:font "Fira Code Retina" :weight light :height 110)))
|
||||||
|
|
||||||
|
(add-to-list 'default-frame-alist `(font . "Fira Code Retina"))
|
||||||
|
(set-face-attribute 'default nil :font "Fira Code Retina" :height 110)
|
||||||
|
(set-face-attribute 'fixed-pitch nil :font "Fira Code Retina" :height 110)
|
||||||
|
(set-face-attribute 'variable-pitch nil :font "Fira Code Retina" :height 110 :weight 'regular)
|
||||||
|
(set-fontset-font t 'hangul (font-spec :family "D2Coding" :height 110))
|
||||||
|
(setq face-font-rescale-alist
|
||||||
|
'(("D2Coding" . 1.25)))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Theme
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(scroll-bar-mode -1) ; Disable visible scrollbar
|
||||||
|
(tool-bar-mode -1) ; Disable the toolbar
|
||||||
|
(tooltip-mode -1) ; Disable tooltips
|
||||||
|
(set-fringe-mode 10) ; Give some breathing room
|
||||||
|
(xterm-mouse-mode)
|
||||||
|
|
||||||
|
(menu-bar-mode -1) ; Disable the menu bar
|
||||||
|
|
||||||
|
|
||||||
|
;;(setq visible-bell t)
|
||||||
|
;; Transparency
|
||||||
|
(defun toggle-transparency ()
|
||||||
|
(interactive)
|
||||||
|
(let ((alpha (frame-parameter nil 'alpha)))
|
||||||
|
(set-frame-parameter
|
||||||
|
nil 'alpha
|
||||||
|
(if (eql (cond ((numberp alpha) alpha)
|
||||||
|
((numberp (cdr alpha)) (cdr alpha))
|
||||||
|
;; Also handle undocumented (<active> <inactive>) form.
|
||||||
|
((numberp (cadr alpha)) (cadr alpha)))
|
||||||
|
100)
|
||||||
|
gvar/frame-transparency '(85 . 85)))))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-c t") 'toggle-transparency)
|
||||||
|
|
||||||
|
;; Fullscreen
|
||||||
|
(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
|
||||||
|
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||||
|
|
||||||
|
;; line number
|
||||||
|
(column-number-mode)
|
||||||
|
(global-display-line-numbers-mode t)
|
||||||
|
;; Disable line numbers for some modes
|
||||||
|
(dolist (mode '(org-mode-hook
|
||||||
|
vterm-mode-hook
|
||||||
|
shell-mode-hook
|
||||||
|
treemacs-mode-hook
|
||||||
|
dired-mode-hook
|
||||||
|
eshell-mode-hook))
|
||||||
|
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package doom-themes
|
||||||
|
:init
|
||||||
|
(setq doom_themes-enable-bold t
|
||||||
|
doom-themes-enablbe-italic t)
|
||||||
|
:config
|
||||||
|
(load-theme 'doom-palenight t)
|
||||||
|
;;(load-theme 'doom-gruvbox t)
|
||||||
|
;;(load-theme 'doom-one t)
|
||||||
|
;;(load-theme 'doom-dracula t)
|
||||||
|
;; Enable flashing mode-line on errors
|
||||||
|
(doom-themes-visual-bell-config)
|
||||||
|
;; Corrects (and improves) org-mode's native fontification.
|
||||||
|
(doom-themes-org-config))
|
||||||
|
|
||||||
|
|
||||||
|
(global-hl-line-mode t)
|
||||||
|
;;(use-package beacon
|
||||||
|
;; :straight t
|
||||||
|
;; :config
|
||||||
|
;; (beacon-mode))
|
||||||
|
|
||||||
|
(use-package doom-modeline
|
||||||
|
:init (doom-modeline-mode 1)
|
||||||
|
:custom ((doom-modeline-height 15)))
|
||||||
|
|
||||||
|
;; Dashboard
|
||||||
|
(use-package dashboard
|
||||||
|
:ensure t
|
||||||
|
:init
|
||||||
|
(setq dashboard-set-heading-icons t)
|
||||||
|
(setq dashboard-set-file-icons t)
|
||||||
|
;;(setq dashboard-banner-logo-title "Emacs is more than a text editor!")
|
||||||
|
;;(dashboard-startup-banner 'logo)
|
||||||
|
(setq dashboard-startup-banner "/home/jaeus/.emacs.df/logos/emacs-e.png")
|
||||||
|
(setq dashboard-center-content t)
|
||||||
|
(setq dashboard-week-agenda t)
|
||||||
|
(setq dashboard-agenda-time-string-format "%d/%m/%Y %A %H:%M")
|
||||||
|
(setq dashboard-items '((recents . 10)
|
||||||
|
(agenda . 5)
|
||||||
|
(bookmarks . 5)
|
||||||
|
;;(projects . 5)
|
||||||
|
(registers . 5)))
|
||||||
|
(setq dashboard-set-navigator t)
|
||||||
|
;; Format: "(icon title help action face prefix suffix)"
|
||||||
|
(setq dashboard-navigator-buttons
|
||||||
|
`((;; Github
|
||||||
|
(,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
|
||||||
|
"Github"
|
||||||
|
"Browse github"
|
||||||
|
(lambda (&rest _) (browse-url "https://github.com/JaeUs3792/"))))))
|
||||||
|
;;(,(all-the-icons-octicon "history" :height 1.1 :v-adjust 0.0)
|
||||||
|
;; "Reload last session"
|
||||||
|
;; "Reload last session"
|
||||||
|
;; (lambda (&rest _) (persp-state-load persp-state-default-file))))))
|
||||||
|
:config
|
||||||
|
(dashboard-setup-startup-hook)
|
||||||
|
(dashboard-modify-heading-icons '((recents . "file-text")
|
||||||
|
(bookmarks . "book"))))
|
||||||
|
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Vertico
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package vertico
|
||||||
|
:ensure t
|
||||||
|
:bind (:map vertico-map
|
||||||
|
("C-j" . vertico-next)
|
||||||
|
("C-k" . vertico-previous))
|
||||||
|
:custom
|
||||||
|
(vertico-cycle t)
|
||||||
|
:init
|
||||||
|
(vertico-mode))
|
||||||
|
(use-package savehist
|
||||||
|
:init
|
||||||
|
(savehist-mode))
|
||||||
|
|
||||||
|
(use-package marginalia
|
||||||
|
:after vertico
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
||||||
|
:init
|
||||||
|
(marginalia-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))
|
||||||
|
(use-package embark
|
||||||
|
:bind (("C-S-a" . embark-act)
|
||||||
|
:map minibuffer-local-map
|
||||||
|
("C-d" . embark-act))
|
||||||
|
:config
|
||||||
|
|
||||||
|
;; Show Embark actions via which-key
|
||||||
|
(setq embark-action-indicator
|
||||||
|
(lambda (map)
|
||||||
|
(which-key--show-keymap "Embark" map nil nil 'no-paging)
|
||||||
|
#'which-key--hide-popup-ignore-command)
|
||||||
|
embark-become-indicator embark-action-indicator))
|
||||||
|
|
||||||
|
(use-package embark-consult
|
||||||
|
:after embark)
|
||||||
|
|
||||||
|
;;(defun dw/get-project-root ()
|
||||||
|
;; (when (fboundp 'projectile-project-root)
|
||||||
|
;; (projectile-project-root)))
|
||||||
|
|
||||||
|
(use-package consult
|
||||||
|
:demand t
|
||||||
|
:bind (("C-s" . consult-line)
|
||||||
|
("C-M-l" . consult-imenu)
|
||||||
|
("C-M-j" . persp-switch-to-buffer*)
|
||||||
|
:map minibuffer-local-map
|
||||||
|
("C-r" . consult-history))
|
||||||
|
:custom
|
||||||
|
;;(consult-project-root-function #'dw/get-project-root)
|
||||||
|
(completion-in-region-function #'consult-completion-in-region))
|
||||||
|
(use-package consult-dir
|
||||||
|
:straight t
|
||||||
|
:bind (("C-x C-d" . consult-dir)
|
||||||
|
:map vertico-map
|
||||||
|
("C-x C-d" . consult-dir)
|
||||||
|
("C-x C-j" . consult-dir-jump-file))
|
||||||
|
:custom
|
||||||
|
(consult-dir-project-list-function nil))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Evil
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(defun ju/evil-hook()
|
||||||
|
(dolist (mode '(custom-mode
|
||||||
|
erc-mode))
|
||||||
|
(add-to-list 'evil-emacs-state-modes mode)))
|
||||||
|
(use-package undo-tree
|
||||||
|
:init
|
||||||
|
(global-undo-tree-mode 1))
|
||||||
|
(use-package evil
|
||||||
|
:ensure t
|
||||||
|
:init
|
||||||
|
(setq evil-want-integration t)
|
||||||
|
(setq evil-want-keybinding nil)
|
||||||
|
(setq evil-want-C-u-scroll t)
|
||||||
|
(setq evil-want-C-i-jump nil)
|
||||||
|
(setq evil-undo-system 'undo-tree)
|
||||||
|
:config
|
||||||
|
(add-hook 'evil-mode-hook 'ju/evil-hook)
|
||||||
|
(evil-mode 1)
|
||||||
|
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
|
||||||
|
;;(setq-default evil-symbol-word-search t) ;; evil can identify the word with underscore.
|
||||||
|
;; Http://blog.binchen.org/posts/auto-complete-word-in-emacs-mini-buffer-when-using-evil.html
|
||||||
|
;;(defun minibuffer-inactive-mode-hook-setup ()
|
||||||
|
;;;; make `try-expand-dabbrev' from `hippie-expand' work in mini-buffer
|
||||||
|
;;;; @see `he-dabbrev-beg', so we need re-define syntax for '/'
|
||||||
|
;;(set-syntax-table (let* ((table (make-syntax-table)))
|
||||||
|
;;(modify-syntax-entry ?/ "." table)
|
||||||
|
;;table)))
|
||||||
|
;;(add-hook 'minibuffer-inactive-mode-hook 'minibuffer-inactive-mode-hook-setup)
|
||||||
|
|
||||||
|
;; Use visual line motions even outside of visual-line-mode buffers
|
||||||
|
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
|
||||||
|
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)
|
||||||
|
(evil-set-initial-state 'messages-buffer-mode 'normal)
|
||||||
|
(evil-set-initial-state 'dashboard-mode 'normal))
|
||||||
|
(use-package evil-numbers
|
||||||
|
:after evil
|
||||||
|
:config
|
||||||
|
;; 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/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/dec-at-pt))
|
||||||
|
(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-visual-state-map (kbd "g c") 'evilnc-comment-or-uncomment-lines))
|
||||||
|
|
||||||
|
(use-package evil-collection
|
||||||
|
:after evil
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(evil-collection-init))
|
||||||
|
|
||||||
|
(modify-syntax-entry ?_ "w")
|
||||||
|
;;(defalias 'forward-evil-word 'forward-evil-symbol) ;; include underscore to word
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Company
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package company
|
||||||
|
:init
|
||||||
|
(add-hook 'after-init-hook 'global-company-mode)
|
||||||
|
:bind
|
||||||
|
(:map company-active-map
|
||||||
|
("<tab>" . company-complete-selection))
|
||||||
|
(:map lsp-mode-map
|
||||||
|
("<tab>" . company-indent-or-complete-common))
|
||||||
|
:config
|
||||||
|
(setq company-idle-delay 0
|
||||||
|
company-show-numbers "on"
|
||||||
|
company-dabbrev-downcase nil
|
||||||
|
)
|
||||||
|
(add-to-list 'company-backends 'org-keyword-backend))
|
||||||
|
(use-package flycheck
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
|
:init (global-flycheck-mode t))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Org mode
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(defun org-keyword-backend (command &optional arg &rest ignored)
|
||||||
|
(interactive (list 'interactive))
|
||||||
|
(cl-case command
|
||||||
|
(interactive (company-begin-backend 'org-keyword-backend))
|
||||||
|
(prefix (and (eq major-mode 'org-mode)
|
||||||
|
(cons (company-grab-line "^#\\+\\(\\w*\\)" 1)
|
||||||
|
t)))
|
||||||
|
(candidates (mapcar #'upcase
|
||||||
|
(cl-remove-if-not
|
||||||
|
(lambda (c) (string-prefix-p arg c))
|
||||||
|
(pcomplete-completions))))
|
||||||
|
(ignore-case t)
|
||||||
|
(duplicates t)))
|
||||||
|
|
||||||
|
(defun efs/org-mode-setup ()
|
||||||
|
(org-indent-mode)
|
||||||
|
;;(variable-pitch-mode 1)
|
||||||
|
(visual-line-mode 1))
|
||||||
|
|
||||||
|
(use-package org
|
||||||
|
:commands (org-capture org-agenda)
|
||||||
|
:hook (org-mode . efs/org-mode-setup)
|
||||||
|
:config
|
||||||
|
|
||||||
|
(setq org-todo-keywords
|
||||||
|
'((sequence "TODO(t)" "HOLD(h)" "|" "KILL(k)" "DONE(d)")))
|
||||||
|
(setq org-ellipsis " ▾")
|
||||||
|
(setq org-hide-emphasis-markers t)
|
||||||
|
(setq org-src-fontify-natively t)
|
||||||
|
(setq org-fontify-quote-and-verse-blocks t)
|
||||||
|
|
||||||
|
(setq org-agenda-start-with-log-mode t)
|
||||||
|
(setq org-log-done 'time)
|
||||||
|
(setq org-log-into-drawer t)
|
||||||
|
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.8)))
|
||||||
|
(use-package org-superstar :after org :hook (org-mode . org-superstar-mode))
|
||||||
|
(use-package org-attach-screenshot)
|
||||||
|
(use-package org-download)
|
||||||
|
|
||||||
|
(defun efs/org-mode-visual-fill ()
|
||||||
|
(setq visual-fill-column-width 100
|
||||||
|
visual-fill-column-center-text t)
|
||||||
|
(visual-fill-column-mode 1))
|
||||||
|
|
||||||
|
(use-package visual-fill-column
|
||||||
|
:hook (org-mode . efs/org-mode-visual-fill))
|
||||||
|
|
||||||
|
(with-eval-after-load 'org
|
||||||
|
(org-babel-do-load-languages
|
||||||
|
'org-babel-load-languages
|
||||||
|
'((emacs-lisp . t)
|
||||||
|
(python . t)
|
||||||
|
(latex . t)))
|
||||||
|
|
||||||
|
(push '("conf-unix" . conf-unix) org-src-lang-modes))
|
||||||
|
|
||||||
|
(with-eval-after-load 'org
|
||||||
|
;; This is needed as of Org 9.2
|
||||||
|
(require 'org-tempo)
|
||||||
|
|
||||||
|
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("cc" . "src c"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("cp" . "src c++"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("oc" . "src octave"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("vl" . "src verilog"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("vh" . "src vhdl")))
|
||||||
|
|
||||||
|
;; ODT export to docx
|
||||||
|
(setq org-odt-preferred-output-format "docx")
|
||||||
|
|
||||||
|
;; Do not ask when run code block
|
||||||
|
(setq org-confirm-babel-evaluate nil)
|
||||||
|
|
||||||
|
(use-package org-contrib)
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Org Roam
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package org-roam
|
||||||
|
:ensure t
|
||||||
|
:demand t ;; Ensure org-roam is loaded by default
|
||||||
|
:init
|
||||||
|
(setq org-roam-v2-ack t)
|
||||||
|
:custom
|
||||||
|
(org-roam-directory "~/Roam")
|
||||||
|
(org-roam-completion-everywhere t)
|
||||||
|
|
||||||
|
:config
|
||||||
|
(org-roam-db-autosync-mode))
|
||||||
|
;;(org-roam-setup))
|
||||||
|
(defun org-roam-node-insert-immediate (arg &rest args)
|
||||||
|
(interactive "P")
|
||||||
|
(let ((args (push arg args))
|
||||||
|
(org-roam-capture-templates (list (append (car org-roam-capture-templates)
|
||||||
|
'(:immediate-finish t)))))
|
||||||
|
(apply #'org-roam-node-insert args)))
|
||||||
|
|
||||||
|
(defun my/org-roam-filter-by-tag (tag-name)
|
||||||
|
(lambda (node)
|
||||||
|
(member tag-name (org-roam-node-tags node))))
|
||||||
|
|
||||||
|
(defun my/org-roam-list-notes-by-tag (tag-name)
|
||||||
|
(mapcar #'org-roam-node-file
|
||||||
|
(seq-filter
|
||||||
|
(my/org-roam-filter-by-tag tag-name)
|
||||||
|
(org-roam-node-list))))
|
||||||
|
|
||||||
|
(defun my/org-roam-refresh-agenda-list ()
|
||||||
|
(interactive)
|
||||||
|
(setq org-agenda-files (my/org-roam-list-notes-by-tag "Project")))
|
||||||
|
|
||||||
|
;; Build the agenda list the first time for the session
|
||||||
|
(my/org-roam-refresh-agenda-list)
|
||||||
|
|
||||||
|
(defun my/org-roam-project-finalize-hook ()
|
||||||
|
"Adds the captured project file to `org-agenda-files' if the
|
||||||
|
capture was not aborted."
|
||||||
|
;; Remove the hook since it was added temporarily
|
||||||
|
(remove-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
|
||||||
|
|
||||||
|
;; Add project file to the agenda list if the capture was confirmed
|
||||||
|
(unless org-note-abort
|
||||||
|
(with-current-buffer (org-capture-get :buffer)
|
||||||
|
(add-to-list 'org-agenda-files (buffer-file-name)))))
|
||||||
|
|
||||||
|
(defun my/org-roam-find-project ()
|
||||||
|
(interactive)
|
||||||
|
;; Add the project file to the agenda after capture is finished
|
||||||
|
(add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
|
||||||
|
|
||||||
|
;; Select a project file to open, creating it if necessary
|
||||||
|
(org-roam-node-find
|
||||||
|
nil
|
||||||
|
nil
|
||||||
|
(my/org-roam-filter-by-tag "Project")
|
||||||
|
:templates
|
||||||
|
'(("p" "project" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* History\n\n* Notes\n\n"
|
||||||
|
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: Project")
|
||||||
|
:unnarrowed t))))
|
||||||
|
|
||||||
|
(add-to-list 'org-after-todo-state-change-hook
|
||||||
|
(lambda ()
|
||||||
|
(when (equal org-state "DONE")
|
||||||
|
(my/org-roam-copy-todo-to-today))))
|
||||||
|
(use-package websocket
|
||||||
|
:after org-roam)
|
||||||
|
(use-package org-roam-ui
|
||||||
|
:straight
|
||||||
|
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
|
||||||
|
:after org-roam
|
||||||
|
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
|
||||||
|
;; a hookable mode anymore, you're advised to pick something yourself
|
||||||
|
;; if you don't care about startup time, use
|
||||||
|
;; :hook (after-init . org-roam-ui-mode)
|
||||||
|
:config
|
||||||
|
(setq org-roam-ui-sync-theme t
|
||||||
|
org-roam-ui-follow t
|
||||||
|
org-roam-ui-update-on-save t
|
||||||
|
org-roam-ui-open-on-start nil))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Org mode etc.
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package ob-translate
|
||||||
|
:config
|
||||||
|
(setq ob-translate:default-dest "ko"))
|
||||||
|
|
||||||
|
(use-package pdf-tools
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(pdf-tools-install)
|
||||||
|
(setq-default pdf-view-display-size 'fit-width)
|
||||||
|
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
|
||||||
|
:custom
|
||||||
|
(pdf-annot-activate-created-annotations t "automatically annotate highlights"))
|
||||||
|
(use-package org-pdfview
|
||||||
|
:straight t)
|
||||||
|
(use-package org-noter)
|
||||||
|
(setq org-publish-use-timestamps-flag nil)
|
||||||
|
(setq org-export-with-broken-lilnks t)
|
||||||
|
(setq org-publish-project-alist
|
||||||
|
'(("jaeus.net"
|
||||||
|
:base-directory "~/Roam/www/"
|
||||||
|
:base-extension "org"
|
||||||
|
:publishing-directory "~/Projects/html/"
|
||||||
|
:recursive t
|
||||||
|
:publishing-function org-html-publish-to-html
|
||||||
|
:headline-levels 4
|
||||||
|
:auto-preamble t)))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Magit
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package magit
|
||||||
|
:commands (magit-status magit-get-current-branch)
|
||||||
|
:custom
|
||||||
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
||||||
|
;; NOTE: Make sure to configure a GitHub token before using this package!
|
||||||
|
;; - https://magit.vc/manual/forge/Token-Creation.html#Token-Creation
|
||||||
|
;; - https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started
|
||||||
|
(use-package forge
|
||||||
|
:after magit)
|
||||||
|
(use-package magit-todos
|
||||||
|
:defer t)
|
||||||
|
(use-package git-link)
|
||||||
|
(use-package git-gutter
|
||||||
|
:straight git-gutter-fringe
|
||||||
|
;;:diminish
|
||||||
|
:hook ((text-mode . git-gutter-mode)
|
||||||
|
(prog-mode . git-gutter-mode))
|
||||||
|
:config
|
||||||
|
(setq git-gutter:update-interval 2)
|
||||||
|
(require 'git-gutter-fringe)
|
||||||
|
(set-face-foreground 'git-gutter-fr:added "LightGreen")
|
||||||
|
(fringe-helper-define 'git-gutter-fr:added nil
|
||||||
|
".XXXXXX."
|
||||||
|
"XX....XX"
|
||||||
|
"X......X"
|
||||||
|
"X......X"
|
||||||
|
"XXXXXXXX"
|
||||||
|
"XXXXXXXX"
|
||||||
|
"X......X"
|
||||||
|
"X......X")
|
||||||
|
|
||||||
|
(set-face-foreground 'git-gutter-fr:modified "LightGoldenrod")
|
||||||
|
(fringe-helper-define 'git-gutter-fr:modified nil
|
||||||
|
"XXXXXXXX"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X"
|
||||||
|
"X..XX..X")
|
||||||
|
|
||||||
|
(set-face-foreground 'git-gutter-fr:deleted "LightCoral")
|
||||||
|
(fringe-helper-define 'git-gutter-fr:deleted nil
|
||||||
|
"XXXXXX.."
|
||||||
|
"XX....X."
|
||||||
|
"XX.....X"
|
||||||
|
"XX.....X"
|
||||||
|
"XX.....X"
|
||||||
|
"XX.....X"
|
||||||
|
"XX....X."
|
||||||
|
"XXXXXX..")
|
||||||
|
|
||||||
|
;; These characters are used in terminal mode
|
||||||
|
(setq git-gutter:modified-sign "≡")
|
||||||
|
(setq git-gutter:added-sign "≡")
|
||||||
|
(setq git-gutter:deleted-sign "≡")
|
||||||
|
(set-face-foreground 'git-gutter:added "LightGreen")
|
||||||
|
(set-face-foreground 'git-gutter:modified "LightGoldenrod")
|
||||||
|
(set-face-foreground 'git-gutter:deleted "LightCoral"))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; EShell
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package exec-path-from-shell)
|
||||||
|
(exec-path-from-shell-initialize)
|
||||||
|
(defun dw/get-prompt-path ()
|
||||||
|
(let* ((current-path (eshell/pwd))
|
||||||
|
(git-output (shell-command-to-string "git rev-parse --show-toplevel"))
|
||||||
|
(has-path (not (string-match "^fatal" git-output))))
|
||||||
|
(if (not has-path)
|
||||||
|
(abbreviate-file-name current-path)
|
||||||
|
(string-remove-prefix (file-name-directory git-output) current-path))))
|
||||||
|
|
||||||
|
(defun dw/eshell-prompt ()
|
||||||
|
(let ((current-branch (magit-get-current-branch)))
|
||||||
|
(concat
|
||||||
|
"\n"
|
||||||
|
(propertize (system-name) 'face `(:foreground "#62aeed"))
|
||||||
|
(propertize " ॐ " 'face `(:foreground "white"))
|
||||||
|
(propertize (dw/get-prompt-path) 'face `(:foreground "#82cfd3"))
|
||||||
|
(when current-branch
|
||||||
|
(concat
|
||||||
|
(propertize " • " 'face `(:foreground "white"))
|
||||||
|
(propertize (concat " " current-branch) 'face `(:foreground "#c475f0"))))
|
||||||
|
(propertize " • " 'face `(:foreground "white"))
|
||||||
|
(propertize (format-time-string "%I:%M:%S %p") 'face `(:foreground "#5a5b7f"))
|
||||||
|
(if (= (user-uid) 0)
|
||||||
|
(propertize "\n#" 'face `(:foreground "red2"))
|
||||||
|
(propertize "\nλ" 'face `(:foreground "#aece4a")))
|
||||||
|
(propertize " " 'face `(:foreground "white")))))
|
||||||
|
|
||||||
|
(defun efs/configure-eshell ()
|
||||||
|
;; Save command history when commands are entered
|
||||||
|
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)
|
||||||
|
|
||||||
|
;; Truncate buffer for performance
|
||||||
|
(add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer)
|
||||||
|
|
||||||
|
;; Bind some useful keys for evil-mode
|
||||||
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
|
||||||
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
|
||||||
|
(evil-normalize-keymaps)
|
||||||
|
|
||||||
|
(setq eshell-prompt-function 'dw/eshell-prompt
|
||||||
|
eshell-prompt-regexp "^λ "
|
||||||
|
eshell-history-size 10000
|
||||||
|
eshell-buffer-maximum-lines 10000
|
||||||
|
eshell-hist-ignoredups t
|
||||||
|
eshell-scroll-to-bottom-on-input t))
|
||||||
|
|
||||||
|
(use-package eshell-git-prompt
|
||||||
|
:after eshell)
|
||||||
|
|
||||||
|
(use-package eshell
|
||||||
|
:hook (eshell-first-time-mode . efs/configure-eshell)
|
||||||
|
:config
|
||||||
|
|
||||||
|
(with-eval-after-load 'esh-opt
|
||||||
|
(setq eshell-destroy-buffer-when-process-dies t)
|
||||||
|
(setq eshell-visual-commands '("htop" "zsh" "vim"))))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Dired
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package dired
|
||||||
|
:ensure nil
|
||||||
|
:straight nil
|
||||||
|
:commands (dired dired-jump)
|
||||||
|
:bind (("C-x C-j" . dired-jump))
|
||||||
|
:custom ((dired-listing-switches "-agho --group-directories-first"))
|
||||||
|
:config
|
||||||
|
(evil-collection-define-key 'normal 'dired-mode-map
|
||||||
|
"h" 'dired-single-up-directory
|
||||||
|
"l" 'dired-single-buffer))
|
||||||
|
(autoload 'dired-omit-mode "dired-x")
|
||||||
|
(add-hook 'dired-load-hook
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(dired-collapse)))
|
||||||
|
;; to use h,l key
|
||||||
|
(use-package dired-single
|
||||||
|
:commands (dired dired-jump))
|
||||||
|
(use-package diredfl
|
||||||
|
:hook (dired-mode . diredfl-mode))
|
||||||
|
|
||||||
|
;; from doom emacs
|
||||||
|
(defun +dired-enable-git-info-h ()
|
||||||
|
"Enable `dired-git-info-mode' in git repos."
|
||||||
|
(and (not (file-remote-p default-directory))
|
||||||
|
(locate-dominating-file "." ".git")
|
||||||
|
(dired-git-info-mode 1)))
|
||||||
|
(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
|
||||||
|
;; wdired-mode.
|
||||||
|
;;(when EMACS27+
|
||||||
|
(defvar +wdired-icons-enabled -1))
|
||||||
|
|
||||||
|
;;(defadvice! +dired-disable-icons-in-wdired-mode-a (&rest _)
|
||||||
|
;; :before #'wdired-change-to-wdired-mode
|
||||||
|
;; (setq-local +wdired-icons-enabled (if all-the-icons-dired-mode 1 -1))
|
||||||
|
;; (when all-the-icons-dired-mode
|
||||||
|
;; (all-the-icons-dired-mode -1)))
|
||||||
|
|
||||||
|
;;(defadvice! +dired-restore-icons-after-wdired-mode-a (&rest _)
|
||||||
|
;; :after #'wdired-change-to-dired-mode
|
||||||
|
;; (all-the-icons-dired-mode +wdired-icons-enabled))))
|
||||||
|
;;(use-package fd-dired)
|
||||||
|
|
||||||
|
(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))
|
||||||
|
;;(use-package ranger
|
||||||
|
;; :config
|
||||||
|
;; (setq ranger-preview-file t)
|
||||||
|
;; (setq ranger-show-preview t)
|
||||||
|
;; (setq ranger-show-literal nil)
|
||||||
|
;; (ranger-override-dired-mode t))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Support File Type
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; EPUB Support
|
||||||
|
(use-package nov)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; ELFEED RSS
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package elfeed
|
||||||
|
:config
|
||||||
|
(setq elfeed-search-feed-face ":foreground #fff :weight bold"
|
||||||
|
elfeed-feeds (quote
|
||||||
|
(("https://www.reddit.com/r/linux.rss" reddit linux)
|
||||||
|
("https://www.reddit.com/r/emacs.rss" reddit emacs)
|
||||||
|
("https://www.gamingonlinux.com/article_rss.php" gaming linux)
|
||||||
|
("https://hackaday.com/blog/feed/" hackaday linux)
|
||||||
|
("https://opensource.com/feed" opensource linux)
|
||||||
|
("https://linux.softpedia.com/backend.xml" softpedia linux)
|
||||||
|
("https://itsfoss.com/feed/" itsfoss linux)
|
||||||
|
("https://www.zdnet.com/topic/linux/rss.xml" zdnet linux)
|
||||||
|
("https://www.phoronix.com/rss.php" phoronix linux)
|
||||||
|
("http://feeds.feedburner.com/d0od" omgubuntu linux)
|
||||||
|
("https://www.computerworld.com/index.rss" computerworld linux)
|
||||||
|
("https://www.networkworld.com/category/linux/index.rss" networkworld linux)
|
||||||
|
("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linux)
|
||||||
|
("https://betanews.com/feed" betanews linux)
|
||||||
|
("http://lxer.com/module/newswire/headlines.rss" lxer linux)
|
||||||
|
("https://coolenjoy.net/rss?bo_table=38" coolenjoy IT)
|
||||||
|
("https://gigglehd.com/gg/ggnews/rss" giggle IT)))))
|
||||||
|
|
||||||
|
(use-package elfeed-goodies
|
||||||
|
:init
|
||||||
|
(elfeed-goodies/setup)
|
||||||
|
:config
|
||||||
|
(setq elfeed-goodies/entry-pane-size 0.5))
|
||||||
|
|
||||||
|
(add-hook 'elfeed-show-mode-hook 'visual-line-mode)
|
||||||
|
(evil-define-key 'normal elfeed-show-mode-map
|
||||||
|
(kbd "J") 'elfeed-goodies/split-show-next
|
||||||
|
(kbd "K") 'elfeed-goodies/split-show-prev)
|
||||||
|
(evil-define-key 'normal elfeed-search-mode-map
|
||||||
|
(kbd "J") 'elfeed-goodies/split-show-next
|
||||||
|
(kbd "K") 'elfeed-goodies/split-show-prev)
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; LSP
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package lsp-mode
|
||||||
|
:init
|
||||||
|
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
||||||
|
(setq lsp-keymap-prefix "C-c l")
|
||||||
|
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
||||||
|
(c++-mode . lsp)
|
||||||
|
(verilog-mode . lsp)
|
||||||
|
;; if you want which-key integration
|
||||||
|
(lsp-mode . lsp-enable-which-key-integration))
|
||||||
|
:commands lsp)
|
||||||
|
|
||||||
|
;; optionally
|
||||||
|
(use-package lsp-ui :commands lsp-ui-mode)
|
||||||
|
;; if you are ivy user
|
||||||
|
(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
|
||||||
|
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)
|
||||||
|
;; optionally if you want to use debugger
|
||||||
|
(use-package dap-mode)
|
||||||
|
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Language Support
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package rust-mode)
|
||||||
|
(use-package jupyter
|
||||||
|
:straight t)
|
||||||
|
(org-babel-do-load-languages
|
||||||
|
'org-babel-load-languages
|
||||||
|
'((emacs-lisp . t) ;; Other languages
|
||||||
|
(shell . t)
|
||||||
|
;; Python & Jupyter
|
||||||
|
(python . t)
|
||||||
|
(jupyter . t)))
|
||||||
|
(org-babel-jupyter-override-src-block "python")
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Keymap
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package which-key
|
||||||
|
:defer 0
|
||||||
|
:diminish which-key-mode
|
||||||
|
:config
|
||||||
|
(which-key-mode)
|
||||||
|
(setq which-key-idle-delay 0.5))
|
||||||
|
|
||||||
|
(use-package general
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(general-evil-setup t)
|
||||||
|
(general-create-definer ju/leader-key-def
|
||||||
|
:keymaps '(normal insert visual emacs)
|
||||||
|
:prefix "SPC"
|
||||||
|
:global-prefix "C-SPC"))
|
||||||
|
|
||||||
|
(ju/leader-key-def
|
||||||
|
"." 'find-file
|
||||||
|
;; Buffer
|
||||||
|
"b" '(:ignore t :which-key "buffer handling")
|
||||||
|
"b b" '(ibuffer :which-key "IBuffer")
|
||||||
|
"b k" '(kill-current-buffer :which-key "Kill current buffer")
|
||||||
|
"b n" '(next-buffer :which-key "Next buffer")
|
||||||
|
"b p" '(previous-buffer :which-key "Previous buffer")
|
||||||
|
"b B" '(ibuffer-list-buffers :which-key "IBuffer List Buffers")
|
||||||
|
"b K" '(kill-buffer :which-key "IBuffer Kill Buffers")
|
||||||
|
;; Eshell
|
||||||
|
"e" '(:ignore t :which-key "eshell")
|
||||||
|
"e h" '(counsel-esh-history :which "Kill history")
|
||||||
|
"e s" '(eshell :which "run eshell")
|
||||||
|
;; Magit
|
||||||
|
"g" 'magit
|
||||||
|
;; Workspace
|
||||||
|
;; Counsel
|
||||||
|
"f" '(:ignore t :which-key "file op.")
|
||||||
|
"f r" '(consult-recent-file :which-key "Recent files")
|
||||||
|
"f R" '(revert-buffer :which-key "Revert Buffer")
|
||||||
|
"t t" '(toggle-truncate-lines :which-key "Toggle truncate lines")
|
||||||
|
;; Shortcut
|
||||||
|
"f d d" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.df/desktop.el")) :which-key "open exwm config")
|
||||||
|
"f d e" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.df/init.el")) :which-key "open emacs config")
|
||||||
|
;; Insert something
|
||||||
|
"i" '(:ignore t :which-key "insert something.")
|
||||||
|
"ie" '(emojify-insert-emoji :which-key "emoji")
|
||||||
|
;; AVY (easymotion)
|
||||||
|
"v" '(:ignore t :which-key "Avy")
|
||||||
|
"vc" '(avy-goto-char :which-key "Avy Goto Char")
|
||||||
|
"vw" '(avy-goto-word-0 :which-key "Avy Goto Word")
|
||||||
|
"vl" '(avy-goto-line :which-key "Avy Goto Line")
|
||||||
|
;; Org mode
|
||||||
|
"o" '(:ignore t :which-key "Org mode")
|
||||||
|
"oa" '(:ignore t :which-key "Org Agenda")
|
||||||
|
"oar" '(my/org-roam-refresh-agenda-list :which-key "Org agenda refresh list")
|
||||||
|
"oaa" '(org-agenda :which-key "open org agenda")
|
||||||
|
;; project.el
|
||||||
|
"p" '(:ignore t :which-key "Project")
|
||||||
|
"p." 'project-find-file
|
||||||
|
"ps" 'project-switch-project
|
||||||
|
"pg" 'consult-ripgrep
|
||||||
|
"pc" 'project-compile
|
||||||
|
"pd" 'project-dired
|
||||||
|
;; Org roam
|
||||||
|
"r" '(:ignore t :which-key "Org Roam")
|
||||||
|
"ru" 'org-roam-ui-open
|
||||||
|
"rl" 'org-roam-buffer-toggle
|
||||||
|
"rf" 'org-roam-node-find
|
||||||
|
"ri" 'org-roam-node-insert
|
||||||
|
"rI" 'org-roam-node-insert-immediate
|
||||||
|
"rp" 'my/org-roam-find-project)
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-M-j") 'consult-buffer)
|
||||||
|
;; Key binding
|
||||||
|
;; Make ESC quit prompts
|
||||||
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||||
|
;; this annoying binding.
|
||||||
|
(global-unset-key (kbd "C-j"))
|
||||||
|
(global-unset-key (kbd "C-k"))
|
||||||
|
(global-unset-key (kbd "S-SPC")) ;; use only S-\
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; ETC
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
(use-package emojify
|
||||||
|
:hook (after-init . global-emojify-mode))
|
||||||
|
(use-package super-save
|
||||||
|
:defer 1
|
||||||
|
:diminish super-save-mode
|
||||||
|
:config
|
||||||
|
(super-save-mode +1)
|
||||||
|
(setq super-save-auto-save-when-idle t))
|
||||||
|
(setq global-auto-revert-non-file-buffers t)
|
||||||
|
(global-auto-revert-mode 1)
|
||||||
|
;; tramp default is scp
|
||||||
|
(setq tramp-default-method "ssh")
|
||||||
|
;; AVY (like easymotion)
|
||||||
|
(use-package avy
|
||||||
|
:straight t
|
||||||
|
:commands (avy-goto-char avy-goto-word-0 avy-goto-line))
|
||||||
|
(use-package hl-todo
|
||||||
|
:straight t
|
||||||
|
:hook (prog-mode . hl-todo-mode)
|
||||||
|
:hook (yaml-mode . hl-todo-mode)
|
||||||
|
:config
|
||||||
|
(setq hl-todo-highlight-punctuation ":"
|
||||||
|
hl-todo-keyword-faces
|
||||||
|
`(;; For things that need to be done, just not today.
|
||||||
|
("TODO" warning bold)
|
||||||
|
;; For problems that will become bigger problems later if not
|
||||||
|
;; fixed ASAP.
|
||||||
|
("FIXME" error bold)
|
||||||
|
;; For tidbits that are unconventional and not intended uses of the
|
||||||
|
;; constituent parts, and may break in a future update.
|
||||||
|
("HACK" font-lock-constant-face bold)
|
||||||
|
;; For things that were done hastily and/or hasn't been thoroughly
|
||||||
|
;; tested. It may not even be necessary!
|
||||||
|
("REVIEW" font-lock-keyword-face bold)
|
||||||
|
;; For especially important gotchas with a given implementation,
|
||||||
|
;; directed at another user other than the author.
|
||||||
|
("NOTE" success bold)
|
||||||
|
;; For things that just gotta go and will soon be gone.
|
||||||
|
("DEPRECATED" font-lock-doc-face bold)
|
||||||
|
;; For a known bug that needs a workaround
|
||||||
|
("BUG" error bold)
|
||||||
|
;; For warning about a problematic or misguiding code
|
||||||
|
("XXX" font-lock-constant-face bold)))
|
||||||
|
(global-hl-todo-mode))
|
||||||
|
|
||||||
|
(use-package helpful
|
||||||
|
:commands (helpful-callable helpful-variable helpful-command helpful-key)
|
||||||
|
:custom
|
||||||
|
(counsel-describe-function-function #'helpful-callable)
|
||||||
|
(counsel-describe-variable-function #'helpful-variable)
|
||||||
|
:bind
|
||||||
|
([remap describe-function] . describe-function)
|
||||||
|
([remap describe-command] . helpful-command)
|
||||||
|
([remap describe-variable] . describe-variable)
|
||||||
|
([remap describe-key] . helpful-key))
|
||||||
|
(use-package openwith
|
||||||
|
:after dired
|
||||||
|
:config
|
||||||
|
(setq larget-file-warning-threshold nil)
|
||||||
|
(openwith-mode t)
|
||||||
|
(setq openwith-associations
|
||||||
|
(list (list (openwith-make-extension-regexp
|
||||||
|
'("mpg" "mpeg" "mp3" "mp4" "m4v"
|
||||||
|
"avi" "wmv" "wav" "mov" "flv"
|
||||||
|
"ogm" "ogg" "mkv"))
|
||||||
|
"mpv"
|
||||||
|
'(file))
|
||||||
|
(list (openwith-make-extension-regexp
|
||||||
|
'("pdf"))
|
||||||
|
"evince"
|
||||||
|
'(file)))))
|
||||||
|
(use-package vlf
|
||||||
|
:config (progn
|
||||||
|
(require 'vlf-setup)))
|
||||||
|
|
||||||
|
;; Don't let ediff break EXWM, keep it in one frame
|
||||||
|
(setq ediff-diff-options "-w"
|
||||||
|
ediff-split-window-function 'split-window-horizontally
|
||||||
|
ediff-window-setup-function 'ediff-setup-windows-plain)
|
||||||
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,3 +3,6 @@
|
|||||||
/.emacs.rational.d/backups/
|
/.emacs.rational.d/backups/
|
||||||
/.emacs.rational.d/var/
|
/.emacs.rational.d/var/
|
||||||
/.emacs.rational.d/undo/
|
/.emacs.rational.d/undo/
|
||||||
|
/.config/htop/
|
||||||
|
/.config/qutebrowser/
|
||||||
|
/.config/tmux/
|
||||||
|
|||||||
Reference in New Issue
Block a user