mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-13 23:51:34 +09:00
230518-1
This commit is contained in:
53
.config/emacs/custom.el
Normal file
53
.config/emacs/custom.el
Normal file
@ -0,0 +1,53 @@
|
||||
(setq user-full-name "JaeYoo-Im"
|
||||
user-mail-address "cpu3792@gmail.com")
|
||||
(setq default-input-method "korean-hangul")
|
||||
|
||||
(defun custom-setup-fonts ()
|
||||
"setup fonts..."
|
||||
(when (display-graphic-p)
|
||||
;; default font
|
||||
(cl-loop for font in '("FiraCode Nerd Font Mono" "Jetbrains Mono"
|
||||
"Source Code Pro" "DejaVu Sans Mono")
|
||||
when (font-installed-p font)
|
||||
return (set-face-attribute 'default nil
|
||||
:family font
|
||||
:height 130))
|
||||
;; uni code caracter
|
||||
(cl-loop for font in '("Segoe UI Symbol" "Symbola" "Symbol")
|
||||
when (font-installed-p font)
|
||||
return (set-fontset-font t 'symbol (font-spec :family font) nil 'prepend))
|
||||
|
||||
;; Emoji
|
||||
(cl-loop for font in '("Noto Color Emoji" "Apple Color Emoji" "Segoe UI Emoji")
|
||||
when (font-installed-p font)
|
||||
return (cond
|
||||
((< emacs-major-version 27)
|
||||
(set-fontset-font "fontset-default" 'unicode font nil 'prepend))
|
||||
((< emacs-major-version 28)
|
||||
(set-fontset-font t 'symbol (font-spec :family font) nil 'prepend))
|
||||
(t
|
||||
(set-fontset-font t 'emoji (font-spec :family font) nil 'prepend))))
|
||||
|
||||
;; Noto font or Nanum
|
||||
(cl-loop for font in '("Noto Sans CJK KR" "Nanum Gothic")
|
||||
when (font-installed-p font)
|
||||
return (progn
|
||||
(setq face-font-rescale-alist `((,font . 1.26)))
|
||||
(set-fontset-font t '(#x1100 . #xffdc) (font-spec :family font))))))
|
||||
|
||||
|
||||
(custom-setup-fonts)
|
||||
(add-hook 'window-setup-hook #'custom-setup-fonts)
|
||||
(add-hook 'server-after-make-frame-hook #'centaur-setup-fonts)
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(paradox-github-token t))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
)
|
||||
@ -1,8 +1,6 @@
|
||||
;;; early-init.el -*- lexical-binding: t -*-
|
||||
;; do not garbage collection during startup
|
||||
(setq gc-cons-threshold most-positive-fixnum)
|
||||
;; prefers newest version of a file
|
||||
(customize-set-variable 'load-prefer-newer t)
|
||||
|
||||
;;; Native compilation settings
|
||||
(when (featurep 'native-compile)
|
||||
@ -16,7 +14,7 @@
|
||||
(setq use-package-enable-imenu-support t)
|
||||
|
||||
;;
|
||||
(setq non-prefer-newer noninteractive)
|
||||
(setq load-prefer-newer noninteractive)
|
||||
(setq frame-inhibit-implied-resize t)
|
||||
|
||||
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||
@ -26,7 +24,7 @@
|
||||
(push '(ns-transparent-titlebar . t) default-frame-alist))
|
||||
(setq-default mode-line-format nil)
|
||||
|
||||
(setq inhibit-startup-message nil)
|
||||
;;(setq inhibit-startup-message nil)
|
||||
|
||||
;; initial load with blue theme
|
||||
;(load-theme 'deeper-blue)
|
||||
|
||||
@ -55,9 +55,12 @@ Otherwise the startup will be very slow. "
|
||||
(require 'init-package)
|
||||
|
||||
(require 'init-base)
|
||||
(require 'init-hydra)
|
||||
|
||||
(require 'init-ui)
|
||||
(require 'init-edit)
|
||||
(require 'init-evil)
|
||||
|
||||
(require 'init-vertico)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; init.el ends here
|
||||
|
||||
@ -12,14 +12,13 @@
|
||||
evil-want-C-u-scroll t
|
||||
evil-want-C-i-jump nil)
|
||||
;;(setq evil-respect-visual-line-mode nil) ; t : on the screen, nil : by cr characters
|
||||
(require 'evil-vars)
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
;;(evil-set-undo-system 'undo-redo)
|
||||
|
||||
;; Make evil search more like vim (makes emacs slow)
|
||||
;;(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
|
||||
:config
|
||||
(require 'evil-vars)
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
;;(evil-set-undo-system 'undo-redo)
|
||||
(setq evil-want-fine-undo t) ; more granular undo with evil
|
||||
(evil-set-initial-state 'messages-buffer-mode 'normal)
|
||||
(evil-set-initial-state 'dashboard-mode 'normal)
|
||||
|
||||
@ -9,7 +9,10 @@
|
||||
(if (fboundp 'buffer-line-statistics)
|
||||
(> (car (buffer-line-statistics)) 10000)
|
||||
(> (buffer-size) 100000)))
|
||||
|
||||
(defun icons-displayable-p ()
|
||||
"Return non-nil if icons are displayable."
|
||||
(or (featurep 'nerd-icons)
|
||||
(require 'nerd-icons nil t)))
|
||||
|
||||
(provide 'init-func)
|
||||
;;; init-func.el ends here
|
||||
|
||||
78
.config/emacs/lisp/init-hydra.el
Normal file
78
.config/emacs/lisp/init-hydra.el
Normal file
@ -0,0 +1,78 @@
|
||||
;; init-hydra.el -*- lexical-binding: t -*-
|
||||
(require 'init-const)
|
||||
(require 'init-func)
|
||||
(use-package hydra
|
||||
:hook (emacs-lisp-mode . hydra-add-imenu))
|
||||
|
||||
;; TODO
|
||||
(use-package pretty-hydra
|
||||
:bind ("<f6>" . toggles-hydra/body)
|
||||
:hook (emacs-lisp-mode . (lambda ()
|
||||
(add-to-list
|
||||
'imenu-generic-expression
|
||||
'("Hydras"
|
||||
"^.*(\\(pretty-hydra-define\\) \\([a-zA-Z-]+\\)"
|
||||
2))))
|
||||
:init
|
||||
(cl-defun pretty-hydra-title (title &optional icon-type icon-name
|
||||
&key face height v-adjust)
|
||||
"Add an icon in the hydra title."
|
||||
(let ((face (or face `(:foreground ,(face-background 'highlight))))
|
||||
(height (or height 1.2))
|
||||
(v-adjust (or v-adjust 0.0)))
|
||||
(concat
|
||||
(when (and (icons-displayable-p) icon-type icon-name)
|
||||
(let ((f (intern (format "nerd-icons-%s" icon-type))))
|
||||
(when (fboundp f)
|
||||
(concat
|
||||
(apply f (list icon-name :face face :height height :v-adjust v-adjust))
|
||||
" "))))
|
||||
(propertize title 'face face))))
|
||||
|
||||
;; Global toggles
|
||||
(with-no-warnings
|
||||
(pretty-hydra-define toggles-hydra (:title (pretty-hydra-title "Toggles" 'faicon "nf-fa-toggle_on")
|
||||
:color amaranth :quit-key ("q" "C-g"))
|
||||
("Basic"
|
||||
(("n" (cond ((fboundp 'display-line-numbers-mode)
|
||||
(display-line-numbers-mode (if display-line-numbers-mode -1 1)))
|
||||
((fboundp 'gblobal-linum-mode)
|
||||
(global-linum-mode (if global-linum-mode -1 1))))
|
||||
"line number"
|
||||
:toggle (or (bound-and-true-p display-line-numbers-mode)
|
||||
(bound-and-true-p global-linum-mode)))
|
||||
("a" global-aggressive-indent-mode "aggressive indent" :toggle t)
|
||||
("d" global-hungry-delete-mode "hungry delete" :toggle t)
|
||||
("e" electric-pair-mode "electric pair" :toggle t)
|
||||
("c" flyspell-mode "spell check" :toggle t)
|
||||
("s" prettify-symbols-mode "pretty symbol" :toggle t)
|
||||
("l" global-page-break-lines-mode "page break lines" :toggle t)
|
||||
("b" display-battery-mode "battery" :toggle t)
|
||||
("i" display-time-mode "time" :toggle t)
|
||||
("m" doom-modeline-mode "modern mode-line" :toggle t))
|
||||
"Highlight"
|
||||
(("h l" global-hl-line-mode "line" :toggle t)
|
||||
("h p" show-paren-mode "paren" :toggle t)
|
||||
("h s" symbol-overlay-mode "symbol" :toggle t)
|
||||
("h r" rainbow-mode "rainbow" :toggle t)
|
||||
("h w" (setq-default show-trailing-whitespace (not show-trailing-whitespace))
|
||||
"whitespace" :toggle show-trailing-whitespace)
|
||||
("h d" rainbow-delimiters-mode "delimiter" :toggle t)
|
||||
("h i" highlight-indent-guides-mode "indent" :toggle t)
|
||||
("h t" global-hl-todo-mode "todo" :toggle t))
|
||||
"Program"
|
||||
(("f" flycheck-mode "flycheck" :toggle t)
|
||||
("F" flymake-mode "flymake" :toggle t)
|
||||
("O" hs-minor-mode "hideshow" :toggle t)
|
||||
("u" subword-mode "subword" :toggle t)
|
||||
("W" which-function-mode "which function" :toggle t)
|
||||
("E" toggle-debug-on-error "debug on error" :toggle (default-value 'debug-on-error))
|
||||
("Q" toggle-debug-on-quit "debug on quit" :toggle (default-value 'debug-on-quit))
|
||||
("v" global-diff-hl-mode "gutter" :toggle t)
|
||||
("V" diff-hl-flydiff-mode "live gutter" :toggle t)
|
||||
("M" diff-hl-margin-mode "margin gutter" :toggle t)
|
||||
("D" diff-hl-dired-mode "dired gutter" :toggle t))))))
|
||||
|
||||
|
||||
(provide 'init-hydra)
|
||||
;;; init-hydra.el ends here
|
||||
@ -19,16 +19,8 @@
|
||||
(advice-add 'package--save-selected-packages :override #'my-package--save-selected-packages)
|
||||
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
|
||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
||||
(customize-set-variable 'package-archive-priorities
|
||||
'(("gnu" . 99) ; prefer GNU packages
|
||||
("nongnu" . 80) ; use non-gnu packages if
|
||||
; not found in GNU elpa
|
||||
("stable" . 70) ; prefer "released" versions
|
||||
; from melpa
|
||||
("melpa" . 0))) ; if all else fails, get it
|
||||
; from melpa
|
||||
|
||||
(unless (bound-and-true-p package--initialized)
|
||||
(setq package-enable-at-startup nil)
|
||||
(package-initialize))
|
||||
|
||||
@ -38,14 +38,14 @@
|
||||
doom-modeline-persp-icon t
|
||||
doom-modeline-display-default-persp-name t
|
||||
doom-modeline-indent-info t))
|
||||
(use-package hide-mode-line
|
||||
:hook (((completion-list-mode
|
||||
completion-in-region-mode
|
||||
eshell-mode shell-mode
|
||||
term-mode vterm-mode
|
||||
treemacs-mode
|
||||
lsp-ui-imenu-mode
|
||||
pdf-annot-list-mode) . hide-mode-line-mode)))
|
||||
;;(use-package hide-mode-line
|
||||
;; :hook (((completion-list-mode
|
||||
;; completion-in-region-mode
|
||||
;; eshell-mode shell-mode
|
||||
;; term-mode vterm-mode
|
||||
;; treemacs-mode
|
||||
;; lsp-ui-imenu-mode
|
||||
;; pdf-annot-list-mode) . hide-mode-line-mode)))
|
||||
|
||||
;; A minor-mode menu for mode-line
|
||||
(use-package minions
|
||||
|
||||
117
.config/emacs/lisp/init-vertico.el
Normal file
117
.config/emacs/lisp/init-vertico.el
Normal file
@ -0,0 +1,117 @@
|
||||
;;; init-vertico.el -*- lexical-binding: t -*-
|
||||
(require 'init-const)
|
||||
(require 'init-func)
|
||||
|
||||
(use-package vertico
|
||||
:bind (:map vertico-map
|
||||
("C-j" . vertico-next)
|
||||
("C-k" . vertico-previous))
|
||||
:hook (after-init . vertico-mode)
|
||||
:custom
|
||||
(vertico-cycle t))
|
||||
|
||||
;; simple, but effective sorting and filtering for emacs.
|
||||
(use-package vertico-prescient
|
||||
:defer t
|
||||
:config
|
||||
(vertico-prescient-mode))
|
||||
|
||||
;; annotations placed at the margin of the minibuffer
|
||||
(use-package marginalia
|
||||
:after vertico
|
||||
:defer t
|
||||
:custom
|
||||
(marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
||||
:init (marginalia-mode))
|
||||
|
||||
|
||||
(use-package consult
|
||||
:demand t
|
||||
:bind (:map minibuffer-local-map
|
||||
("C-r" . consult-history))
|
||||
:custom
|
||||
(completion-in-region-function #'consult-completion-in-region)
|
||||
:config
|
||||
(global-set-key (kbd "C-s") 'consult-line)
|
||||
(global-set-key (kbd "C-M-j") 'consult-buffer))
|
||||
|
||||
(use-package orderless
|
||||
:defer t
|
||||
:custom
|
||||
(completion-styles '(orderless basic))
|
||||
(completion-category-overrides '((file (style basic partial-completion)))))
|
||||
|
||||
;; Quick action in minibuffer
|
||||
(use-package embark
|
||||
:defer t
|
||||
:bind (("C-." . embark-act))
|
||||
:config
|
||||
(with-eval-after-load 'embark-consult
|
||||
(add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
|
||||
(global-set-key [remap describe-bindings] #'embark-bindings)
|
||||
;; Use Embark to show bindings in a key prefix with `C-h`
|
||||
(setq prefix-help-command #'embark-prefix-help-command))
|
||||
|
||||
(use-package embark-consult
|
||||
:defer t
|
||||
:after embark)
|
||||
|
||||
;;; Corfu
|
||||
(use-package corfu
|
||||
:custom
|
||||
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
|
||||
(corfu-auto t) ;; Enable auto completion
|
||||
(corfu-auto-prefix 2)
|
||||
(corfu-auto-delay 0.0)
|
||||
(corfu-echo-documentation 0.25)
|
||||
;; (corfu-separator ?\s) ;; Orderless field separator
|
||||
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
|
||||
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
|
||||
;; (corfu-preview-current nil) ;; Disable current candidate preview
|
||||
;; (corfu-preselect 'prompt) ;; Preselect the prompt
|
||||
;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
|
||||
;; (corfu-scroll-margin 5) ;; Use scroll margin
|
||||
:init
|
||||
(global-corfu-mode)
|
||||
(require 'corfu-popupinfo)
|
||||
(corfu-popupinfo-mode 1)
|
||||
(eldoc-add-command #'corfu-insert)
|
||||
(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-d") #'corfu-popupinfo-toggle))
|
||||
|
||||
(use-package corfu-terminal
|
||||
:config
|
||||
(unless (display-graphic-p)
|
||||
(corfu-terminal-mode)))
|
||||
|
||||
(use-package kind-icon
|
||||
:ensure t
|
||||
:after corfu
|
||||
:custom
|
||||
(kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
|
||||
:config
|
||||
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
||||
|
||||
;;; Cape
|
||||
;; Setup Cape for better completion-at-point support and more
|
||||
(use-package cape
|
||||
:config
|
||||
;; Add useful defaults completion sources from cape
|
||||
(add-to-list 'completion-at-point-functions #'cape-file)
|
||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||
;;(add-to-list 'completion-at-point-functions #'cape-ispell)
|
||||
;; Silence the pcomplete capf, no errors or messages!
|
||||
;; Important for corfu
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
||||
;; Ensure that pcomplete does not write to the buffer
|
||||
;; and behaves as a pure `completion-at-point-function'.
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)
|
||||
(add-hook 'eshell-mode-hook
|
||||
(lambda () (setq-local corfu-quit-at-boundary t
|
||||
corfu-quit-no-match t
|
||||
corfu-auto nil)
|
||||
(corfu-mode))))
|
||||
|
||||
(provide 'init-vertico)
|
||||
;;; init-vertico.el ends here
|
||||
@ -17,6 +17,7 @@ alias emt="emacsclient -c -a 'emacs -nw'"
|
||||
alias emtangle="emacs --batch -eval \"(require 'org)\" --eval '(org-babel-tangle-file \"~/.config/emacs/emacs.org\")'"
|
||||
#neovim to vi
|
||||
alias vi=nvim
|
||||
alias vimdiff="nvim -d"
|
||||
alias cat=bat
|
||||
#pacman unlock
|
||||
alias paruunlock="sudo rm /var/lib/pacman/db.lck"
|
||||
|
||||
Reference in New Issue
Block a user