Update March 2022
This commit is contained in:
@@ -5,213 +5,72 @@
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets.
|
||||
(setq user-full-name "minhtrannhat"
|
||||
user-mail-address "minhtrannhat@tutanota.com")
|
||||
;; clients, file templates and snippets. It is optional.
|
||||
(setq user-full-name "John Doe"
|
||||
user-mail-address "john@doe.com")
|
||||
|
||||
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
|
||||
;; are the three important ones:
|
||||
;; Doom exposes five (optional) variables for controlling fonts in Doom:
|
||||
;;
|
||||
;; + `doom-font'
|
||||
;; + `doom-variable-pitch-font'
|
||||
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||
;; - `doom-font' -- the primary font to use
|
||||
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
|
||||
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||
;; presentations or streaming.
|
||||
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 18)
|
||||
doom-big-font (font-spec :family "JetBrainsMono Nerd Font" :size 26)
|
||||
doom-variable-pitch-font (font-spec :family "Overpass" :size 16)
|
||||
doom-unicode-font (font-spec :family "JuliaMono")
|
||||
doom-serif-font (font-spec :family "IBM Plex Mono" :weight 'light))
|
||||
;; - `doom-unicode-font' -- for unicode glyphs
|
||||
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
|
||||
;;
|
||||
;; See 'C-h v doom-font' for documentation and more examples of what they
|
||||
;; accept. For example:
|
||||
;;
|
||||
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
|
||||
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
|
||||
;;
|
||||
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
|
||||
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
||||
;; refresh your font settings. If Emacs still can't find your font, it likely
|
||||
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
||||
|
||||
(setq doom-emoji-fallback-font-families nil)
|
||||
(setq doom-symbol-fallback-font-families nil)
|
||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||
;; `load-theme' function. This is the default:
|
||||
(setq doom-theme 'doom-one)
|
||||
|
||||
(setq fancy-splash-image "/home/minhradz/.doom.d/marivector.png")
|
||||
|
||||
(defun synchronize-theme ()
|
||||
(let* ((light-theme 'doom-gruvbox-light)
|
||||
(dark-theme 'doom-gruvbox)
|
||||
(start-time-light-theme 6)
|
||||
(end-time-light-theme 16)
|
||||
(hour (string-to-number (substring (current-time-string) 11 13)))
|
||||
(next-theme (if (member hour (number-sequence start-time-light-theme end-time-light-theme))
|
||||
light-theme dark-theme)))
|
||||
(when (not (equal doom-theme next-theme))
|
||||
(setq doom-theme next-theme)
|
||||
(load-theme next-theme t))))
|
||||
|
||||
(setq doom-nord-light-region-highlight 't)
|
||||
|
||||
(run-with-timer 0 900 'synchronize-theme)
|
||||
|
||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
|
||||
(with-eval-after-load 'doom-themes
|
||||
(doom-themes-treemacs-config))
|
||||
(setq doom-themes-treemacs-theme "doom-colors")
|
||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||
(setq display-line-numbers-type t)
|
||||
|
||||
;; If you use `org' and don't want your org files in the default location below,
|
||||
;; change `org-directory'. It must be set before org loads!
|
||||
(setq org-directory "~/org/")
|
||||
|
||||
(setq display-line-numbers-type 'relative)
|
||||
|
||||
(add-hook 'spell-fu-mode-hook
|
||||
(lambda ()
|
||||
(spell-fu-dictionary-add (spell-fu-get-ispell-dictionary "en"))
|
||||
(spell-fu-dictionary-add
|
||||
(spell-fu-get-personal-dictionary "en-personal" "/home/minhradz/.aspell.en.pws"))))
|
||||
|
||||
;; Clangd lsp for C/C++ dev
|
||||
(setq lsp-clients-clangd-args '("-j=3"
|
||||
"--background-index"
|
||||
"--clang-tidy"
|
||||
"--completion-style=detailed"
|
||||
"--header-insertion=never"
|
||||
"--header-insertion-decorators=0"))
|
||||
(after! lsp-clangd (set-lsp-priority! 'clangd 2))
|
||||
|
||||
;; I mindlessly press ESC, so stop me from wreaking havoc
|
||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||
|
||||
;; update the git gutter
|
||||
(custom-set-variables
|
||||
'(git-gutter:update-interval 0.02))
|
||||
|
||||
;; ;; tree-sitter syntax highlighting
|
||||
;; (use-package! tree-sitter
|
||||
;; :config
|
||||
;; (require 'tree-sitter-langs)
|
||||
;; (global-tree-sitter-mode)
|
||||
;; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
|
||||
|
||||
;; gpg
|
||||
(setq epg-pinentry-mode 'loopback)
|
||||
|
||||
;; both jk and kj now works
|
||||
(setq evil-escape-unordered-key-sequence 't)
|
||||
|
||||
;; org org
|
||||
(setq +latex-viewers '(zathura))
|
||||
|
||||
;; fish fish
|
||||
(setq vterm-shell 'fish)
|
||||
|
||||
(defun doom-modeline-conditional-buffer-encoding ()
|
||||
"We expect the encoding to be LF UTF-8, so only show the modeline when this is not the case"
|
||||
(setq-local doom-modeline-buffer-encoding
|
||||
(unless (and (memq (plist-get (coding-system-plist buffer-file-coding-system) :category)
|
||||
'(coding-category-undecided coding-category-utf-8))
|
||||
(not (memq (coding-system-eol-type buffer-file-coding-system) '(1 2))))
|
||||
t)))
|
||||
|
||||
(add-hook 'after-change-major-mode-hook #'doom-modeline-conditional-buffer-encoding)
|
||||
|
||||
(after! company
|
||||
(setq company-idle-delay 1)
|
||||
(add-hook 'evil-normal-state-entry-hook #'company-abort)) ;; make aborting less annoying.
|
||||
|
||||
(use-package all-the-icons-ivy-rich
|
||||
:init (all-the-icons-ivy-rich-mode 1))
|
||||
|
||||
(use-package ivy-rich
|
||||
:init (ivy-rich-mode 1))
|
||||
|
||||
(setq-default history-length 1000)
|
||||
(setq-default prescient-history-length 1000)
|
||||
|
||||
;; Whether display the icon for `major-mode'. It respects `doom-modeline-icon'.
|
||||
(setq doom-modeline-major-mode-icon t)
|
||||
|
||||
;; Whether display the colorful icon for `major-mode'.
|
||||
;; It respects `all-the-icons-color-icons'.
|
||||
(setq doom-modeline-major-mode-color-icon t)
|
||||
|
||||
;; Whether display the icon for the buffer state. It respects `doom-modeline-icon'.
|
||||
(setq doom-modeline-buffer-state-icon t)
|
||||
|
||||
;; Whether display the modification icon for the buffer.
|
||||
;; It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'.
|
||||
(setq doom-modeline-buffer-modification-icon t)
|
||||
|
||||
;; Whether to use unicode as a fallback (instead of ASCII) when not using icons.
|
||||
(setq doom-modeline-unicode-fallback nil)
|
||||
|
||||
;; Whether display the minor modes in the mode-line.
|
||||
(setq doom-modeline-minor-modes nil)
|
||||
|
||||
(use-package! websocket
|
||||
:after org-roam)
|
||||
|
||||
(use-package! org-roam-ui
|
||||
:after org-roam
|
||||
: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 t))
|
||||
|
||||
(setq org-roam-dailies-directory "daily/")
|
||||
|
||||
(setq org-roam-dailies-capture-templates
|
||||
'(("d" "default" entry
|
||||
"* %?"
|
||||
:target (file+head "%<%Y-%m-%d>.org"
|
||||
"#+title: %<%Y-%m-%d>\n* What I did today\n* What was on my mind"))))
|
||||
|
||||
(defun org-roam-rg-search ()
|
||||
"Search org-roam directory using consult-ripgrep. With live-preview."
|
||||
(interactive)
|
||||
(let ((consult-ripgrep-command "rg --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
|
||||
(consult-ripgrep org-roam-directory)))
|
||||
|
||||
(map! :leader
|
||||
:desc "Search org-roam with consult-ripgrep"
|
||||
"n r F" #'org-roam-rg-search)
|
||||
|
||||
;; Function for inserting node into Org Roam
|
||||
(defun org-roam-node-insert-immediate (arg &rest args)
|
||||
(interactive "P")
|
||||
(let ((args (cons arg args))
|
||||
(org-roam-capture-templates (list (append (car org-roam-capture-templates)
|
||||
'(:immediate-finish t)))))
|
||||
(apply #'org-roam-node-insert args)))
|
||||
|
||||
(map! :leader
|
||||
:desc "Insert node immediately"
|
||||
"n r I" #'org-roam-node-insert-immediate)
|
||||
|
||||
(setq avy-all-windows 't)
|
||||
|
||||
;; Disables lsp-signature-auto-activate
|
||||
;; Looking at you, rustic mode
|
||||
(after! lsp-mode
|
||||
(setq lsp-signature-auto-activate nil))
|
||||
|
||||
;; this never worked lol
|
||||
(lsp-treemacs-sync-mode 1)
|
||||
|
||||
;; bitmap very funni
|
||||
(setq highlight-indent-guides-method 'bitmap)
|
||||
|
||||
;; magit delta looks so good
|
||||
(add-hook 'magit-mode-hook (lambda () (magit-delta-mode +1)))
|
||||
|
||||
;; keybind to disable search highlighting (like :set noh)
|
||||
(map! :leader
|
||||
:desc "Clear search highlight"
|
||||
"s c"
|
||||
#'evil-ex-nohighlight)
|
||||
|
||||
;; We do a little bit of finger pointing
|
||||
(use-package blamer
|
||||
:bind (("s-i" . blamer-show-commit-info))
|
||||
:defer 20
|
||||
:custom
|
||||
(blamer-idle-time 0.3)
|
||||
(blamer-min-offset 40)
|
||||
:custom-face
|
||||
(blamer-face ((t :foreground "#7a88cf"
|
||||
:background nil
|
||||
:height 110
|
||||
:italic t)))
|
||||
:config
|
||||
(global-blamer-mode 1))
|
||||
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
||||
;;
|
||||
;; (after! PACKAGE
|
||||
;; (setq x y))
|
||||
;;
|
||||
;; The exceptions to this rule:
|
||||
;;
|
||||
;; - Setting file/directory variables (like `org-directory')
|
||||
;; - Setting variables which explicitly tell you to set them before their
|
||||
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
|
||||
;; - Setting doom variables (which start with 'doom-' or '+').
|
||||
;;
|
||||
;; Here are some additional functions/macros that will help you configure Doom.
|
||||
;;
|
||||
;; - `load!' for loading external *.el files relative to this one
|
||||
;; - `use-package!' for configuring packages
|
||||
;; - `after!' for running code after a package has loaded
|
||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
||||
;; this file. Emacs searches the `load-path' when you load packages with
|
||||
;; `require' or `use-package'.
|
||||
;; - `map!' for binding new keys
|
||||
;;
|
||||
;; To get information about any of these functions/macros, move the cursor over
|
||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
||||
;; This will open documentation for it, including demos of how they are used.
|
||||
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
|
||||
;; etc).
|
||||
;;
|
||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||
;; they are implemented.
|
||||
|
Reference in New Issue
Block a user