2023-11-29 18:16:24 +04:00
|
|
|
;; -*- lexical-binding: t; -*-
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding (Chinese/Japanese/Korean characters)
|
|
|
|
(set-language-environment 'utf-8)
|
|
|
|
(set-keyboard-coding-system 'utf-8) ; For old Carbon emacs on OS X only
|
|
|
|
(setq locale-coding-system 'utf-8)
|
|
|
|
(set-default-coding-systems 'utf-8)
|
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
(set-selection-coding-system
|
|
|
|
(if (eq system-type 'windows-nt)
|
|
|
|
'utf-16-le ;; https://rufflewind.com/2014-07-20/pasting-unicode-in-emacs-on-windows
|
|
|
|
'utf-8))
|
|
|
|
(prefer-coding-system 'utf-8)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
|
|
|
|
backup-by-copying t
|
|
|
|
version-control t
|
|
|
|
delete-old-versions t
|
|
|
|
kept-new-versions 20
|
|
|
|
kept-old-versions 5)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq frame-resize-pixelwise t)
|
|
|
|
;; ui settings apparently go below
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq default-frame-alist '((font . "JetBrainsMono NF")
|
2023-11-29 18:16:24 +04:00
|
|
|
'(vertical-scroll-bars . nil)
|
|
|
|
'(horizontal-scroll-bars . nil)))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
;; UI/UX
|
|
|
|
(setq inhibit-splash-screen t)
|
|
|
|
;; remove useless GUI elements
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(tooltip-mode -1)
|
|
|
|
(set-fringe-mode 10)
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
;; Line Numbers
|
|
|
|
(column-number-mode)
|
|
|
|
;; Bell
|
2023-12-24 14:43:11 +04:00
|
|
|
(setq visible-bell nil)
|
2023-11-29 18:16:24 +04:00
|
|
|
;; prefer y/n
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
;; Stop Emacs from trying to use dialog boxes.
|
|
|
|
(setq use-dialog-box nil)
|
|
|
|
;; idc emacs just work already
|
|
|
|
(setq warning-minimum-level :emergency)
|
|
|
|
|
|
|
|
(add-hook 'prog-mode 'display-line-numbers-mode)
|
|
|
|
(add-hook 'yaml-mode 'display-line-numbers-mode)
|
|
|
|
(add-hook 'conf-mode 'display-line-numbers-mode)
|
|
|
|
(setq display-line-numbers-width-start t)
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq display-line-numbers-type 'relative)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
;; switch buffers
|
|
|
|
(global-set-key (kbd "C-M-j") 'counsel-switch-buffer)
|
|
|
|
;; instead of control-g
|
|
|
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
;; repeat keybinds
|
|
|
|
(repeat-mode)
|
2023-12-22 19:00:42 +04:00
|
|
|
;; electric pairs
|
|
|
|
(electric-pair-mode)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(set-face-attribute `default nil :font "JetBrainsMono NF" :height 130)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(message "setting up use-package")
|
2023-11-03 15:12:46 +04:00
|
|
|
(require `package)
|
|
|
|
|
|
|
|
(setq package-archives `(("mepla" . "https://melpa.org/packages/")
|
2023-12-23 21:10:06 +04:00
|
|
|
("org" . "https://orgmode.org/elpa/")
|
|
|
|
("elpa" . "https://elpa.gnu.org/packages/")))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(package-initialize)
|
|
|
|
(unless package-archive-contents
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
|
|
|
;; Init package for non-linux
|
|
|
|
(unless (package-installed-p `use-package)
|
|
|
|
(package-install `use-package))
|
|
|
|
|
|
|
|
(require 'use-package)
|
|
|
|
(setq use-package-always-ensure t)
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(message "setting up straight.el")
|
|
|
|
(defvar bootstrap-version)
|
|
|
|
(let ((bootstrap-file
|
|
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
|
|
(bootstrap-version 6))
|
|
|
|
(unless (file-exists-p bootstrap-file)
|
|
|
|
(with-current-buffer
|
|
|
|
(url-retrieve-synchronously
|
|
|
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
|
|
'silent 'inhibit-cookies)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(eval-print-last-sexp)))
|
|
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
|
|
|
|
(use-package gcmh
|
|
|
|
:init
|
|
|
|
(setq gcmh-idle-delay 5)
|
|
|
|
(setq gcmh-high-cons-threshold (* 16 1024 1024))
|
|
|
|
:config
|
|
|
|
(gcmh-mode))
|
|
|
|
|
|
|
|
(setq gc-cons-threshold most-positive-fixnum)
|
|
|
|
|
|
|
|
(defvar sakomacs--file-name-handler-alist file-name-handler-alist)
|
|
|
|
(setq file-name-handler-alist nil)
|
|
|
|
|
|
|
|
;; Alternatively, restore it even later:
|
|
|
|
(add-hook 'emacs-startup-hook
|
|
|
|
(lambda ()
|
|
|
|
(setq file-name-handler-alist sakomacs--file-name-handler-alist)))
|
|
|
|
|
|
|
|
(add-hook 'emacs-startup-hook
|
|
|
|
(lambda ()
|
2023-12-22 19:00:42 +04:00
|
|
|
;;(setq gc-cons-threshold 16777216 ; 16mb
|
2023-12-23 21:10:06 +04:00
|
|
|
;; this could be really bad idk
|
|
|
|
(setq gc-cons-threshold 100000000
|
2023-11-29 18:16:24 +04:00
|
|
|
gc-cons-percentage 0.1)))
|
|
|
|
|
|
|
|
(defun doom-defer-garbage-collection-h ()
|
|
|
|
"Disable garbage collection."
|
|
|
|
(setq gc-cons-threshold most-positive-fixnum))
|
|
|
|
|
|
|
|
(defun doom-restore-garbage-collection-h ()
|
|
|
|
"Restore garbage collection."
|
|
|
|
(run-at-time
|
|
|
|
1 nil (lambda () (setq gc-cons-threshold 16777216))))
|
|
|
|
|
|
|
|
(add-hook 'minibuffer-setup-hook #'doom-defer-garbage-collection-h)
|
|
|
|
(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h)
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq package-native-compile t)
|
|
|
|
(setq comp-deferred-compilation t)
|
|
|
|
(setq native-comp-deferred-compilation-deny-list nil)
|
|
|
|
(setq warning-suppress-log-types '((comp)))
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq mode-line-format nil)
|
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
(kill-local-variable 'mode-line-format)
|
|
|
|
|
|
|
|
(force-mode-line-update)
|
|
|
|
|
|
|
|
(setq-default mode-line-format
|
2023-12-23 21:10:06 +04:00
|
|
|
'((:eval (sakoline-render
|
|
|
|
;; left
|
|
|
|
(quote ("%e"
|
|
|
|
sakoline-evil-mode
|
|
|
|
" "
|
|
|
|
sakoline-buffer-name
|
|
|
|
" "
|
|
|
|
sakoline-buffer-state))
|
|
|
|
;; right
|
|
|
|
(quote (sakoline-major-mode
|
|
|
|
)
|
|
|
|
)))))
|
2023-12-23 20:46:19 +04:00
|
|
|
|
|
|
|
(defun sakoline-render (left right)
|
2023-12-22 19:00:42 +04:00
|
|
|
"Return a string of `window-width' length.
|
2023-12-23 20:46:19 +04:00
|
|
|
Containing LEFT, and RIGHT aligned respectively."
|
2023-12-22 19:00:42 +04:00
|
|
|
(let ((available-width
|
|
|
|
(- (window-total-width)
|
|
|
|
(+ (length (format-mode-line left))
|
|
|
|
(length (format-mode-line right))))))
|
|
|
|
(append left
|
|
|
|
(list (format (format "%%%ds" available-width) ""))
|
|
|
|
right)))
|
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
(defvar-local sakoline-buffer-name
|
|
|
|
'(:eval
|
|
|
|
(propertize (buffer-name) 'face '(:foreground "#ffffff")))
|
|
|
|
"Mode line variable that shows the buffer name.")
|
|
|
|
|
|
|
|
(put 'sakoline-buffer-name 'risky-local-variable t)
|
|
|
|
|
|
|
|
(defface sakoline-major-mode-color
|
|
|
|
'((t :foreground "grey"))
|
|
|
|
"Major Mode color for sakoline.")
|
|
|
|
|
|
|
|
(defun sakoline--major-mode-name ()
|
|
|
|
"Return Capitalized Major Mode"
|
|
|
|
(capitalize (symbol-name major-mode)))
|
|
|
|
|
|
|
|
(defvar-local sakoline-major-mode
|
|
|
|
'(:eval
|
|
|
|
(propertize (sakoline--major-mode-name) 'face 'sakoline-major-mode-color)))
|
|
|
|
|
|
|
|
(put 'sakoline-major-mode 'risky-local-variable t)
|
|
|
|
|
|
|
|
(defface sakoline-evil-visual-color
|
|
|
|
'((t :background "#6600cc" :foreground "black"))
|
|
|
|
"Evil Visual Color")
|
|
|
|
|
|
|
|
(defface sakoline-evil-normal-color
|
|
|
|
'((t :background "#99ff99" :foreground "black"))
|
|
|
|
"Evil Visual Color")
|
|
|
|
|
|
|
|
(defface sakoline-evil-insert-color
|
|
|
|
'((t :background "#00cc66" :foreground "black"))
|
|
|
|
"Evil Visual Color")
|
|
|
|
|
|
|
|
(defface sakoline-evil-emacs-color
|
|
|
|
'((t :background "#9900ff" :foreground "black"))
|
|
|
|
"Evil Visual Color")
|
|
|
|
|
|
|
|
(defface sakoline-evil-operator-color
|
|
|
|
'((t :background "#ff3300" :foreground "black"))
|
|
|
|
"Evil Visual Color")
|
|
|
|
|
|
|
|
(defvar-local sakoline-evil-mode
|
|
|
|
'(:eval (cond
|
|
|
|
((eq evil-state 'visual) (propertize " VISUAL " 'face 'sakoline-evil-visual-color ))
|
|
|
|
((eq evil-state 'normal) (propertize " NORMAL " 'face 'sakoline-evil-normal-color ))
|
|
|
|
((eq evil-state 'insert) (propertize " INSERT " 'face 'sakoline-evil-insert-color ))
|
|
|
|
((eq evil-state 'emacs) (propertize " EMACS " 'face 'sakoline-evil-emacs-color ))
|
|
|
|
((eq evil-state 'operator) (propertize " OPERATOR " 'face 'sakoline-evil-operator-color))
|
2023-12-23 21:10:06 +04:00
|
|
|
"Get current evil mode state")))
|
2023-12-23 20:46:19 +04:00
|
|
|
|
|
|
|
(put 'sakoline-evil-mode 'risky-local-variable t)
|
|
|
|
|
|
|
|
(defface sakoline-buffer-state-readonly
|
|
|
|
'((t :foreground "red"))
|
|
|
|
"Face for read-only buffer")
|
|
|
|
(defface sakoline-buffer-state-modified
|
|
|
|
'((t :foreground "orange"))
|
|
|
|
"Face for modified buffer")
|
|
|
|
|
|
|
|
(defvar-local sakoline-buffer-state
|
|
|
|
'(:eval
|
|
|
|
(cond
|
|
|
|
(buffer-read-only
|
2023-12-23 21:10:06 +04:00
|
|
|
(propertize ">:("
|
|
|
|
'face 'sakoline-buffer-state-readonly
|
|
|
|
'help-echo "buffer is read only"))
|
2023-12-23 20:46:19 +04:00
|
|
|
((buffer-modified-p)
|
2023-12-23 21:10:06 +04:00
|
|
|
(propertize "!!!"
|
|
|
|
'face 'sakoline-buffer-state-modified)))))
|
2023-12-23 20:46:19 +04:00
|
|
|
|
|
|
|
(put 'sakoline-buffer-state 'risky-local-variable t)
|
2023-12-22 19:00:42 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(message "setting up packages")
|
|
|
|
|
|
|
|
(use-package command-log-mode
|
|
|
|
:straight t
|
|
|
|
)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
;; better search
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package swiper
|
|
|
|
:straight t
|
|
|
|
)
|
2023-11-03 15:12:46 +04:00
|
|
|
;; better commands
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package counsel
|
|
|
|
:straight t
|
|
|
|
)
|
2023-11-03 15:12:46 +04:00
|
|
|
;; autocompletion on commands (?)
|
|
|
|
(use-package ivy
|
|
|
|
:diminish
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:bind (("C-s" . swiper)
|
|
|
|
:map ivy-minibuffer-map
|
|
|
|
("TAB" . ivy-alt-done)
|
|
|
|
("C-l" . ivy-alt-done)
|
|
|
|
("C-j" . ivy-next-line)
|
|
|
|
("C-k" . ivy-previous-line)
|
|
|
|
:map ivy-switch-buffer-map
|
|
|
|
("C-k" . ivy-previous-line)
|
|
|
|
("C-l" . ivy-done)
|
|
|
|
("C-d" . ivy-switch-buffer-kill)
|
|
|
|
:map ivy-reverse-i-search-map
|
|
|
|
("C-k" . ivy-previous-line)
|
2023-11-29 18:16:24 +04:00
|
|
|
("C-d" . ivy-reverse-i-search-kill))
|
2023-11-03 15:12:46 +04:00
|
|
|
:demand
|
|
|
|
:config
|
|
|
|
(ivy-mode 1))
|
|
|
|
;; better ivy autocompletion
|
|
|
|
(use-package ivy-rich
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:init
|
|
|
|
(ivy-rich-mode 1))
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
;; ivy in the middle
|
|
|
|
(use-package ivy-posframe
|
|
|
|
:straight t
|
|
|
|
:init
|
|
|
|
(setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-center)))
|
|
|
|
:config
|
|
|
|
(ivy-posframe-mode 1))
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
;; counsel M+X
|
|
|
|
(use-package counsel
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:bind (("M-x" . counsel-M-x)
|
2023-11-29 18:16:24 +04:00
|
|
|
("C-x b" . counsel-ibuffer)
|
|
|
|
("C-x C-f" . counsel-find-file)
|
|
|
|
:map minibuffer-local-map
|
|
|
|
("C-r" . 'counsel-minibuffer-history))
|
2023-11-03 15:12:46 +04:00
|
|
|
:config
|
|
|
|
(setq ivy-inital-inputs-alist nil))
|
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
;; (use-package doom-themes
|
|
|
|
;; :straight t
|
|
|
|
;; :ensure t
|
|
|
|
;; :config
|
|
|
|
;; ;; Global settings (defaults)
|
|
|
|
;; (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
|
|
|
;; doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
|
|
|
;; ;; load the theme
|
|
|
|
;; (load-theme 'doom-monokai-pro t)
|
2023-11-29 18:16:24 +04:00
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
;; (doom-themes-org-config)
|
2023-11-29 18:16:24 +04:00
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
;; (doom-themes-treemacs-config)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
;; ;; Enable flashing mode-line on errors
|
|
|
|
;; (doom-themes-visual-bell-config))
|
|
|
|
|
|
|
|
(use-package timu-macos-theme
|
|
|
|
:straight t
|
|
|
|
:config
|
|
|
|
(load-theme 'timu-macos t))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package all-the-icons)
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package nerd-icons
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:custom
|
|
|
|
;; "Symbols Nerd Font Mono" is the default and is recommended
|
|
|
|
;; but you can use any other Nerd Font if you want
|
|
|
|
(nerd-icons-font-family "JetBrainsMono NF")
|
|
|
|
)
|
|
|
|
|
|
|
|
(use-package rainbow-delimiters
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (prog-mode . rainbow-delimiters-mode))
|
|
|
|
|
|
|
|
(use-package which-key
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:init (which-key-mode)
|
|
|
|
:diminish which-key-mode
|
|
|
|
:config
|
|
|
|
(setq which-key-idle-delay 1))
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
;; (use-package doom-modeline
|
|
|
|
;; :ensure t
|
|
|
|
;; :straight t
|
|
|
|
;; :hook (after-init . doom-modeline-mode)
|
|
|
|
;; :custom ((doom-modeline-height 40)))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
(use-package hide-mode-line
|
|
|
|
:straight t
|
|
|
|
:hook (((treemacs-mode
|
|
|
|
eshell-mode shell-mode
|
|
|
|
term-mode vterm-mode
|
|
|
|
embark-collect-mode
|
|
|
|
lsp-ui-imenu-mode
|
|
|
|
pdf-annot-list-mode
|
2023-12-23 21:10:06 +04:00
|
|
|
dashboard-mode) . turn-on-hide-mode-line-mode)
|
2023-11-29 18:16:24 +04:00
|
|
|
(dired-mode . turn-off-hide-mode-line-mode)))
|
|
|
|
|
|
|
|
(use-package minions
|
|
|
|
:straight t
|
|
|
|
:hook (doom-modeline-mode . minions-mode))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package helpful
|
|
|
|
:ensure t
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:custom
|
|
|
|
(counsel-describe-function-function #'helpful-callable)
|
|
|
|
(counsel-describe-variable-function #'helpful-variable)
|
|
|
|
:bind
|
|
|
|
([remap describe-function ] . counsel-describe-function)
|
|
|
|
([remap describe-command] . helpful-command)
|
|
|
|
([remap describe-variable] . counsel-describe-variable)
|
|
|
|
([remap describe-key] . helpful-key))
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package delsel
|
|
|
|
:straight t
|
|
|
|
:ensure nil
|
|
|
|
:config (delete-selection-mode +1))
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package general
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:config
|
|
|
|
(general-create-definer sakomacs/leader-keys
|
|
|
|
:keymaps `(normal insert visual emacs)
|
|
|
|
:prefix "SPC"
|
|
|
|
:global-prefix "C-SPC")
|
|
|
|
(sakomacs/leader-keys
|
2023-11-29 18:16:24 +04:00
|
|
|
;; code
|
|
|
|
"c" `(:ignore c :which-key "code")
|
|
|
|
"cc" `(compile :which-key "compile")
|
|
|
|
"cC" `(recompile :which-key "compile")
|
|
|
|
"cX" `(lsp-treeemacs-errors-list :which-ley "list errors")
|
|
|
|
;; toggles
|
2023-11-03 15:12:46 +04:00
|
|
|
"t" `(:ignore t :which-key "toggles")
|
|
|
|
"tt" `(counsel-load-theme :which-key "choose theme")
|
2023-11-29 18:16:24 +04:00
|
|
|
;; search
|
|
|
|
"s" `(:ignore s :which-key "search")
|
|
|
|
"sb" `(swiper :which-key "search buffer")
|
|
|
|
;; insert
|
|
|
|
"i" `(:ignore i :which-key "insert")
|
|
|
|
"ie" `(emoji-search :which-key "Emoji")
|
|
|
|
;; project
|
2023-11-03 15:12:46 +04:00
|
|
|
"p" `(:ignore p :which-key "projects")
|
|
|
|
"pp" `(projectile-switch-project :which-key "open project")
|
|
|
|
"pk" `(projectile-kill-buffers :which-key "close project")
|
2023-11-29 18:16:24 +04:00
|
|
|
"pa" `(projectile-add-known-project :which-key "add project")
|
|
|
|
"pR" `(projectile-run-project :which-key "run project")
|
|
|
|
"pt" `(magit-todos-list :which-key "list project todos")
|
|
|
|
"ps" `(projectile-save-project-buffers :which-key "save project")
|
|
|
|
"po" `(projectile-find-other-file :which-key "find other file")
|
|
|
|
"pg" `(projectile-configure-project :which-key "configure project")
|
|
|
|
"pc" `(projectile-compile-project :which-key "compile project")
|
|
|
|
;; open
|
|
|
|
"o" `(:ignore o :which-key "open")
|
|
|
|
"op" `(treemacs :which-key "treemacs")
|
|
|
|
"oP" `(treemacs-find-file :which-key "treemacs find file")
|
|
|
|
"oe" `(eshell :which-key "eshell")
|
2023-12-22 19:00:42 +04:00
|
|
|
"or" `(elfeed :which-key "rss")
|
2023-11-29 18:16:24 +04:00
|
|
|
;; notes
|
|
|
|
"n" `(:ignore o :which-key "notes")
|
|
|
|
"na" `(org-agenda :which-key "agenda")
|
|
|
|
;; quit
|
|
|
|
"q" `(:ignore q :which-key "quit")
|
|
|
|
"qq" `(delete-frame :which-key "close emacs")
|
|
|
|
"qK" `(kill-emacs :which-key "quit emacs")
|
|
|
|
;; git
|
2023-11-03 15:12:46 +04:00
|
|
|
"g" `(:ignore g :which-key "git")
|
2023-11-29 18:16:24 +04:00
|
|
|
"gs" `(magit-status :which-key "status")
|
|
|
|
"gc" `(:ignore gc :which-key "create")
|
|
|
|
"gcr" `(magit-init :which-key "init repo")
|
|
|
|
"gcR" `(magit-clone :which-key "clone repo")
|
|
|
|
"gcc" `(magit-commit-create :which-key "commit")
|
|
|
|
"gci" `(forge-create-issue :which-key "issue")
|
|
|
|
"gcp" `(forge-create-pullreq :which-key "pull request")))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package dashboard
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
|
|
|
:init
|
2023-11-03 15:12:46 +04:00
|
|
|
(setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal
|
|
|
|
(setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
|
2023-11-03 15:12:46 +04:00
|
|
|
(setq dashboard-center-content t)
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq dashboard-projects-backend 'projectile)
|
2023-12-23 20:46:19 +04:00
|
|
|
(setq dashboard-startup-banner "~/.emacs.d/dashboard.png")
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq dashboard-footer-messages '("i think i have emacs pinky"
|
|
|
|
"why are we still using lisp again?"
|
|
|
|
"why is this running on 1/16 threads?!?!?"
|
|
|
|
"still waiting for multithreaded :)"
|
|
|
|
"any day now"
|
|
|
|
"make sure to pray today"
|
|
|
|
"im literally kanye west"
|
|
|
|
"please dont break please dont break"
|
|
|
|
"GNU/Linux/Emacs/???"
|
|
|
|
"what is a GNU/Linux ?????????????"
|
|
|
|
"done!"
|
|
|
|
"remove / for faster emacs on linux"
|
|
|
|
""))
|
|
|
|
(setq dashboard-items '((recents . 3)
|
|
|
|
(projects . 3)
|
2023-11-03 15:12:46 +04:00
|
|
|
(agenda . 5)))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
(setq dashboard-image-banner-max-height 200)
|
|
|
|
(setq dashboard-image-banner-max-width 300)
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
(setq dashboard-page-separator "\n\n")
|
2023-11-03 15:12:46 +04:00
|
|
|
(dashboard-setup-startup-hook))
|
|
|
|
|
|
|
|
(use-package evil
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
: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)
|
|
|
|
:ensure t
|
|
|
|
:demand
|
|
|
|
:config
|
|
|
|
(evil-mode 1)
|
|
|
|
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
|
|
|
|
(define-key evil-insert-state-map (kbd "C-h") `evil-delete-backward-char-and-join)
|
|
|
|
|
|
|
|
;; visual line motion
|
|
|
|
(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))
|
|
|
|
|
|
|
|
;; extra things for Evil
|
|
|
|
(use-package evil-collection
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:after evil
|
|
|
|
:config
|
|
|
|
(evil-collection-init))
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
;; commenting
|
|
|
|
(use-package evil-commentary
|
|
|
|
:straight t
|
|
|
|
:after evil
|
|
|
|
:diminish
|
|
|
|
:config (evil-commentary-mode +1))
|
|
|
|
|
|
|
|
(use-package hydra
|
|
|
|
:straight t
|
|
|
|
)
|
2023-11-03 15:12:46 +04:00
|
|
|
(defhydra hydra-text-scale (:timeout 4)
|
|
|
|
"scale text"
|
|
|
|
("j" text-scale-increase "in")
|
|
|
|
("k" text-scale-decrease "out")
|
|
|
|
("f" nil "finished" :exit t))
|
|
|
|
|
|
|
|
(sakomacs/leader-keys
|
|
|
|
"ts" '(hydra-text-scale/body :which-key "scale text"))
|
|
|
|
|
|
|
|
(use-package projectile
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:diminish projectile-mode
|
|
|
|
:demand
|
|
|
|
:config (projectile-mode)
|
|
|
|
:custom ((projectile-completion-system 'ivy))
|
|
|
|
:bind-keymap
|
|
|
|
("C-c p" . projectile-command-map)
|
|
|
|
:init
|
|
|
|
(when (file-directory-p "~/dev")
|
|
|
|
(setq projectile-project-search-path '("~/dev")))
|
|
|
|
(setq projectile-switch-project-action #'projectile-dired))
|
|
|
|
|
|
|
|
(use-package counsel-projectile
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:config (counsel-projectile-mode))
|
|
|
|
|
|
|
|
(use-package org
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
|
|
|
:hook (org-mode . org-indent-mode)
|
2023-11-03 15:12:46 +04:00
|
|
|
:config
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq org-ellipsis " ↓")
|
2023-11-03 15:12:46 +04:00
|
|
|
(setq org-agenda-start-with-log-mode t)
|
|
|
|
(setq org-log-done 'time)
|
|
|
|
(setq org-log-into-drawer t)
|
|
|
|
|
|
|
|
;; org habits thing
|
|
|
|
(require 'org-habit)
|
|
|
|
(add-to-list 'org-modules 'org-habit)
|
|
|
|
(setq org-habit-graph-column 60)
|
|
|
|
|
|
|
|
;; archive thingy i forgot
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq org-refile-targets
|
2023-12-23 21:10:06 +04:00
|
|
|
'(("archive.org" :maxlevel . 1)))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
;; save org buffer before refile
|
|
|
|
(advice-add 'org-refile :after 'org-save-all-org-buffers)
|
|
|
|
|
|
|
|
;; org agenda files
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq org-agenda-files
|
|
|
|
'("~/org/tasks.org"
|
|
|
|
"~/org/school.org"
|
|
|
|
"~/org/daily.org"
|
|
|
|
"~/org/irl.org"
|
|
|
|
"~/org/work.org"))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
;; Following
|
|
|
|
(setq org-return-follows-link t)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
;; hide stars except for leader star
|
|
|
|
(setq org-hide-leading-stars t)
|
|
|
|
(setq org-hide-emphasis-markers nil)
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
;; org mode src thing
|
|
|
|
(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 '("py" . "src python"))
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(setq org-todo-keywords
|
2023-12-23 21:10:06 +04:00
|
|
|
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
|
|
|
|
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)")))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
(setq org-refile-targets
|
2023-12-23 21:10:06 +04:00
|
|
|
'(("archive.org" :maxlevel . 1)
|
|
|
|
("tasks.org" :maxlevel . 1)))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
;; Save Org buffers after refiling!
|
|
|
|
(advice-add 'org-refile :after 'org-save-all-org-buffers)
|
|
|
|
|
|
|
|
(setq org-tag-alist
|
2023-12-23 21:10:06 +04:00
|
|
|
'((:startgroup)
|
|
|
|
; Put mutually exclusive tags here
|
|
|
|
(:endgroup)
|
|
|
|
("@errand" . ?E)
|
|
|
|
("@home" . ?H)
|
|
|
|
("@work" . ?W)
|
|
|
|
("agenda" . ?a)
|
|
|
|
("planning" . ?p)
|
|
|
|
("publish" . ?P)
|
|
|
|
("batch" . ?b)
|
|
|
|
("note" . ?n)
|
|
|
|
("idea" . ?i)))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
;; Configure custom agenda views
|
|
|
|
(setq org-agenda-custom-commands
|
2023-12-23 21:10:06 +04:00
|
|
|
'(("d" "Dashboard"
|
|
|
|
((agenda "" ((org-deadline-warning-days 7)))
|
|
|
|
(todo "NEXT"
|
|
|
|
((org-agenda-overriding-header "Next Tasks")))
|
|
|
|
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
|
|
|
|
|
|
|
|
("n" "Next Tasks"
|
|
|
|
((todo "NEXT"
|
|
|
|
((org-agenda-overriding-header "Next Tasks")))))
|
|
|
|
|
|
|
|
("W" "Work Tasks" tags-todo "+work-email")
|
|
|
|
|
|
|
|
;; Low-effort next actions
|
|
|
|
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0"
|
|
|
|
((org-agenda-overriding-header "Low Effort Tasks")
|
|
|
|
(org-agenda-max-todos 20)
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
|
|
|
|
("w" "Workflow Status"
|
|
|
|
((todo "WAIT"
|
|
|
|
((org-agenda-overriding-header "Waiting on External")
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "REVIEW"
|
|
|
|
((org-agenda-overriding-header "In Review")
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "PLAN"
|
|
|
|
((org-agenda-overriding-header "In Planning")
|
|
|
|
(org-agenda-todo-list-sublevels nil)
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "BACKLOG"
|
|
|
|
((org-agenda-overriding-header "Project Backlog")
|
|
|
|
(org-agenda-todo-list-sublevels nil)
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "READY"
|
|
|
|
((org-agenda-overriding-header "Ready for Work")
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "ACTIVE"
|
|
|
|
((org-agenda-overriding-header "Active Projects")
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "COMPLETED"
|
|
|
|
((org-agenda-overriding-header "Completed Projects")
|
|
|
|
(org-agenda-files org-agenda-files)))
|
|
|
|
(todo "CANC"
|
|
|
|
((org-agenda-overriding-header "Cancelled Projects")
|
|
|
|
(org-agenda-files org-agenda-files)))))))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
(setq org-capture-templates
|
2023-12-23 21:10:06 +04:00
|
|
|
`(("t" "Tasks / Projects")
|
|
|
|
("tt" "Task" entry (file+olp "~/Projects/Code/emacs-from-scratch/OrgFiles/Tasks.org" "Inbox")
|
2023-11-29 18:16:24 +04:00
|
|
|
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
|
|
|
|
|
2023-12-23 21:10:06 +04:00
|
|
|
("j" "Journal Entries")
|
|
|
|
("jj" "Journal" entry
|
2023-11-29 18:16:24 +04:00
|
|
|
(file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org")
|
|
|
|
"\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n"
|
|
|
|
;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org")
|
|
|
|
:clock-in :clock-resume
|
|
|
|
:empty-lines 1))))
|
|
|
|
|
|
|
|
(use-package olivetti
|
2023-12-22 19:00:42 +04:00
|
|
|
:straight t
|
2023-11-29 18:16:24 +04:00
|
|
|
:hook (org-mode . (lambda () (interactive) (olivetti-mode) (olivetti-set-width 100))))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package org-roam
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:ensure t
|
|
|
|
:custom
|
2023-12-23 20:46:19 +04:00
|
|
|
(org-roam-directory "~/org/notes")
|
|
|
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
|
|
|
("C-c n f" . org-roam-node-find)
|
|
|
|
("C-c n i" . org-roam-node-insert))
|
|
|
|
:config
|
|
|
|
(org-roam-setup))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package treemacs
|
|
|
|
:ensure t
|
|
|
|
:defer t
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:init
|
|
|
|
(with-eval-after-load 'winum
|
|
|
|
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
|
|
|
|
treemacs-deferred-git-apply-delay 0.5
|
|
|
|
treemacs-directory-name-transformer #'identity
|
|
|
|
treemacs-display-in-side-window t
|
|
|
|
treemacs-eldoc-display 'simple
|
|
|
|
treemacs-file-event-delay 2000
|
|
|
|
treemacs-file-extension-regex treemacs-last-period-regex-value
|
|
|
|
treemacs-file-follow-delay 0.2
|
|
|
|
treemacs-file-name-transformer #'identity
|
|
|
|
treemacs-follow-after-init t
|
|
|
|
treemacs-expand-after-init t
|
|
|
|
treemacs-find-workspace-method 'find-for-file-or-pick-first
|
|
|
|
treemacs-git-command-pipe ""
|
|
|
|
treemacs-goto-tag-strategy 'refetch-index
|
|
|
|
treemacs-header-scroll-indicators '(nil . "^^^^^^")
|
|
|
|
treemacs-hide-dot-git-directory t
|
|
|
|
treemacs-indentation 2
|
|
|
|
treemacs-indentation-string " "
|
|
|
|
treemacs-is-never-other-window nil
|
|
|
|
treemacs-max-git-entries 5000
|
|
|
|
treemacs-missing-project-action 'ask
|
|
|
|
treemacs-move-forward-on-expand nil
|
|
|
|
treemacs-no-png-images nil
|
|
|
|
treemacs-no-delete-other-windows t
|
|
|
|
treemacs-project-follow-cleanup nil
|
|
|
|
treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
|
|
|
|
treemacs-position 'left
|
|
|
|
treemacs-read-string-input 'from-child-frame
|
|
|
|
treemacs-recenter-distance 0.1
|
|
|
|
treemacs-recenter-after-file-follow nil
|
|
|
|
treemacs-recenter-after-tag-follow nil
|
|
|
|
treemacs-recenter-after-project-jump 'always
|
|
|
|
treemacs-recenter-after-project-expand 'on-distance
|
|
|
|
treemacs-litter-directories '("/node_modules" "/.venv" "/.cask")
|
|
|
|
treemacs-project-follow-into-home nil
|
|
|
|
treemacs-show-cursor nil
|
|
|
|
treemacs-show-hidden-files t
|
|
|
|
treemacs-silent-filewatch nil
|
|
|
|
treemacs-silent-refresh nil
|
|
|
|
treemacs-sorting 'alphabetic-asc
|
|
|
|
treemacs-select-when-already-in-treemacs 'move-back
|
|
|
|
treemacs-space-between-root-nodes t
|
|
|
|
treemacs-tag-follow-cleanup t
|
|
|
|
treemacs-tag-follow-delay 1.5
|
|
|
|
treemacs-text-scale nil
|
|
|
|
treemacs-user-mode-line-format nil
|
|
|
|
treemacs-user-header-line-format nil
|
|
|
|
treemacs-wide-toggle-width 70
|
|
|
|
treemacs-width 35
|
|
|
|
treemacs-width-increment 1
|
|
|
|
treemacs-width-is-initially-locked t
|
|
|
|
treemacs-workspace-switch-cleanup nil)
|
|
|
|
|
|
|
|
;; The default width and height of the icons is 22 pixels. If you are
|
|
|
|
;; using a Hi-DPI display, uncomment this to double the icon size.
|
|
|
|
;;(treemacs-resize-icons 44)
|
|
|
|
|
|
|
|
(treemacs-follow-mode t)
|
|
|
|
(treemacs-tag-follow-mode t)
|
|
|
|
(treemacs-project-follow-mode t)
|
|
|
|
(treemacs-filewatch-mode t)
|
|
|
|
(treemacs-fringe-indicator-mode 'always)
|
|
|
|
(when treemacs-python-executable
|
|
|
|
(treemacs-git-commit-diff-mode t))
|
|
|
|
|
|
|
|
(pcase (cons (not (null (executable-find "git")))
|
|
|
|
(not (null treemacs-python-executable)))
|
|
|
|
(`(t . t)
|
|
|
|
(treemacs-git-mode 'deferred))
|
|
|
|
(`(t . _)
|
|
|
|
(treemacs-git-mode 'simple)))
|
|
|
|
|
|
|
|
(treemacs-hide-gitignored-files-mode nil))
|
|
|
|
:bind
|
|
|
|
(:map global-map
|
|
|
|
("M-0" . treemacs-select-window)
|
|
|
|
("C-x t 1" . treemacs-delete-other-windows)
|
|
|
|
("C-x t d" . treemacs-select-directory)
|
|
|
|
("C-x t B" . treemacs-bookmark)
|
|
|
|
("C-x t C-t" . treemacs-find-file)
|
|
|
|
("C-x t M-t" . treemacs-find-tag)))
|
|
|
|
|
|
|
|
(use-package treemacs-evil
|
|
|
|
:after (treemacs evil)
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package treemacs-projectile
|
|
|
|
:after (treemacs projectile)
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package treemacs-magit
|
|
|
|
:after (treemacs magit)
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:ensure t)
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(use-package treemacs-nerd-icons
|
|
|
|
:straight t
|
|
|
|
:config
|
|
|
|
(treemacs-load-theme "nerd-icons"))
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package magit
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:custom
|
2023-11-29 18:16:24 +04:00
|
|
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
|
|
|
)
|
|
|
|
(use-package magit-todos
|
|
|
|
:straight t
|
|
|
|
:after magit
|
|
|
|
:config (magit-todos-mode 1))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package forge
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:after magit)
|
|
|
|
(setq auth-sources '("~/.authinfo"))
|
|
|
|
|
|
|
|
(use-package direnv
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:config
|
|
|
|
(direnv-mode))
|
|
|
|
|
|
|
|
(defun sakomacs/lsp-mode-setup ()
|
|
|
|
(setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols))
|
|
|
|
(lsp-headerline-breadcrumb-mode))
|
|
|
|
|
|
|
|
(use-package lsp-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:commands (lsp lsp-deferred)
|
|
|
|
:hook (lsp-mode . sakomacs/lsp-mode-setup)
|
|
|
|
:init
|
|
|
|
(setq lsp-keymap-prefix "C-c l")
|
|
|
|
:config
|
|
|
|
(lsp-enable-which-key-integration t)
|
|
|
|
(setq lsp-keep-workspace-alive nil))
|
|
|
|
|
|
|
|
(use-package lsp-ui
|
|
|
|
:hook (lsp-mode . lsp-ui-mode)
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:custom
|
|
|
|
(lsp-ui-doc-position 'bottom))
|
|
|
|
|
|
|
|
(use-package lsp-treemacs
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:after lsp)
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package lsp-ivy
|
|
|
|
:straight t
|
|
|
|
)
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package web-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (web-mode . lsp)
|
|
|
|
:mode ("\\.html\\'"
|
|
|
|
"\\.css\\'"))
|
|
|
|
|
|
|
|
(use-package js2-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-12-22 19:00:42 +04:00
|
|
|
:mode ("\\.js\\'"
|
2023-12-23 21:10:06 +04:00
|
|
|
"\\.jsx\\'")
|
2023-11-29 18:16:24 +04:00
|
|
|
:hook (js2-mode . lsp)
|
|
|
|
:config
|
|
|
|
(setq web-mode-markup-indent-offset 2) ; HTML
|
|
|
|
(setq web-mode-css-indent-offset 2) ; CSS
|
|
|
|
(setq web-mode-code-indent-offset 2) ; JS/JSX/TS/TSX
|
|
|
|
(setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'"))))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(use-package typescript-mode
|
|
|
|
:straight t
|
|
|
|
:mode ("\\.ts\\'"
|
2023-12-23 21:10:06 +04:00
|
|
|
"\\.tsx\\'")
|
2023-12-22 19:00:42 +04:00
|
|
|
:hook (typescript-mode . lsp))
|
|
|
|
|
|
|
|
(define-derived-mode astro-mode web-mode "astro")
|
|
|
|
(setq auto-mode-alist
|
|
|
|
(append '((".*\\.astro\\'" . astro-mode))
|
|
|
|
auto-mode-alist))
|
|
|
|
|
|
|
|
(add-to-list 'lsp-language-id-configuration
|
|
|
|
'(astro-mode . "astro"))
|
|
|
|
|
|
|
|
(defun astro-get-tsserver ()
|
|
|
|
""
|
|
|
|
(f-join (lsp-workspace-root) "node_modules/typescript/lib/tsserverlibrary.js"))
|
|
|
|
|
|
|
|
(lsp-register-client
|
|
|
|
(make-lsp-client :new-connection (lsp-stdio-connection '("astro-ls" "--stdio"))
|
|
|
|
:activation-fn (lsp-activate-on "astro")
|
|
|
|
:initialization-options (lambda ()
|
|
|
|
`(:typescript (:serverPath ,(astro-get-tsserver))))
|
|
|
|
:server-id 'astro-ls))
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(add-hook 'c-mode-hook 'lsp)
|
|
|
|
(add-hook 'c++-mode-hook 'lsp)
|
|
|
|
|
|
|
|
(use-package cmake-mode
|
|
|
|
:mode "CMakeLists.txt"
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (cmake-mode . lsp))
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(use-package lua-mode
|
|
|
|
:mode "\\.lua\\'"
|
|
|
|
:straight t
|
|
|
|
:hook (lua-mode . lsp))
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package python-mode
|
|
|
|
:mode "\\.py\\'"
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (python-mode . lsp))
|
|
|
|
|
|
|
|
(use-package elpy
|
|
|
|
:after python-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
:custom
|
|
|
|
(elpy-rpc-python-command "python3")
|
|
|
|
|
|
|
|
:config
|
|
|
|
(elpy-enable))
|
|
|
|
|
2023-11-08 20:38:57 +04:00
|
|
|
(use-package lsp-pyright
|
|
|
|
:ensure t
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-08 20:38:57 +04:00
|
|
|
:hook (python-mode . (lambda ()
|
|
|
|
(require 'lsp-pyright)
|
|
|
|
(lsp)))) ; or lsp-deferred
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package haskell-mode
|
|
|
|
:mode "\\.hs\\'"
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (python-mode . lsp))
|
|
|
|
|
|
|
|
(use-package yaml-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
|
|
|
:mode ("\\.yaml\\'"
|
|
|
|
"\\.yml\\'"))
|
2023-11-03 15:12:46 +04:00
|
|
|
|
|
|
|
(use-package nix-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook ((nix-mode . lsp)
|
|
|
|
(nix-mode . format-all-mode)
|
|
|
|
(nix-mode . (lambda () (setq-local format-all-formatters '(("Nix" alejandra))))))
|
|
|
|
:mode "\\.nix\\'")
|
|
|
|
|
|
|
|
(use-package dart-mode
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:hook (dart-mode . lsp)
|
|
|
|
:mode "\\.dart\\'" )
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package markdown-mode
|
|
|
|
:straight t
|
|
|
|
:hook (markdown-mode . visual-line-mode))
|
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(use-package markdown-preview-mode
|
|
|
|
:straight t)
|
|
|
|
|
2023-11-03 15:12:46 +04:00
|
|
|
(use-package evil-nerd-commenter
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-03 15:12:46 +04:00
|
|
|
:bind ("M-/" . evilnc-comment-or-uncomment-lines))
|
|
|
|
|
2023-09-11 13:51:08 +04:00
|
|
|
(use-package company
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
|
|
|
:after lsp-mode
|
|
|
|
:hook (lsp-mode . company-mode)
|
|
|
|
:bind (:map company-active-map
|
2023-12-23 21:10:06 +04:00
|
|
|
("<tab>" . company-complete-selection))
|
2023-11-29 18:16:24 +04:00
|
|
|
(:map lsp-mode-map
|
|
|
|
("<tab>" . company-indent-or-complete-common))
|
|
|
|
:custom
|
|
|
|
(company-minimum-prefix-length 1)
|
|
|
|
(company-idle-delay 0)
|
|
|
|
(company-selection-wrap-around t)
|
|
|
|
(company-tooltip-align-annotations t))
|
2023-09-11 13:51:08 +04:00
|
|
|
|
|
|
|
(use-package company-box
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
|
|
|
:hook (company-mode . company-box-mode))
|
|
|
|
|
|
|
|
(use-package flycheck :straight t :config (global-flycheck-mode +1))
|
|
|
|
|
|
|
|
(use-package format-all
|
|
|
|
:straight t
|
|
|
|
)
|
|
|
|
|
|
|
|
(use-package fancy-compilation
|
|
|
|
:commands (fancy-compilation-mode))
|
|
|
|
|
|
|
|
(with-eval-after-load 'compile
|
|
|
|
(fancy-compilation-mode))
|
|
|
|
|
|
|
|
(use-package yasnippet
|
|
|
|
:straight t
|
|
|
|
:diminish yas-minor-mode
|
|
|
|
:hook (after-init . yas-global-mode))
|
|
|
|
|
|
|
|
(use-package yasnippet-snippets
|
|
|
|
:straight t)
|
2023-09-11 13:51:08 +04:00
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package yasnippet-capf
|
|
|
|
:straight t
|
|
|
|
:init (add-to-list 'completion-at-point-functions #'yasnippet-capf))
|
2023-09-16 11:47:24 +04:00
|
|
|
|
2023-09-15 19:25:56 +04:00
|
|
|
(use-package dired
|
|
|
|
:ensure 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))
|
|
|
|
|
|
|
|
(use-package dired-single)
|
|
|
|
|
|
|
|
;; (use-package dired-open
|
|
|
|
;; :config
|
|
|
|
;; (setq dired-open-extensions '(("png" . "feh")
|
|
|
|
;; ("mkv" . "mpv"))))
|
|
|
|
|
|
|
|
;; (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))
|
|
|
|
|
|
|
|
;; NOTE: If you want to move everything out of the ~/.emacs.d folder
|
|
|
|
;; reliably, set `user-emacs-directory` before loading no-littering!
|
|
|
|
;(setq user-emacs-directory "~/.cache/emacs")
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package no-littering
|
|
|
|
:straight t
|
|
|
|
)
|
2023-09-15 19:25:56 +04:00
|
|
|
|
|
|
|
;; no-littering doesn't set this by default so we must place
|
|
|
|
;; auto save files in the same path as it uses for sessions
|
|
|
|
(setq auto-save-file-name-transforms
|
|
|
|
`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
|
|
|
|
|
2023-11-29 18:16:24 +04:00
|
|
|
(use-package elfeed
|
|
|
|
:straight t
|
2023-12-22 19:00:42 +04:00
|
|
|
:config
|
|
|
|
(setq elfeed-use-curl t)
|
|
|
|
(setq browse-url-browser-function 'eww-browse-url)
|
|
|
|
(setq elfeed-search-title-max-width 100)
|
2023-11-08 20:38:57 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
(use-package elfeed-protocol
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-11-08 20:38:57 +04:00
|
|
|
:after elfeed
|
|
|
|
:config
|
|
|
|
(elfeed-set-timeout 36000)
|
|
|
|
(setq elfeed-curl-extra-arguments '("--insecure")) ;necessary for https without a trust certificate
|
|
|
|
|
|
|
|
;; workaround for smth
|
|
|
|
(setq elfeed-protocol-fever-update-unread-only t)
|
|
|
|
|
|
|
|
;; setup feeds
|
|
|
|
(setq elfeed-protocol-feeds '(("fever+https://sako@rss.sako.box"
|
|
|
|
:api-url "https://rss.sako.box/api/fever.php"
|
|
|
|
:use-authinfo t)))
|
|
|
|
|
|
|
|
;; enable elfeed-protocol
|
2023-12-22 19:00:42 +04:00
|
|
|
(setq elfeed-protocol-enabled-protocols '(fever))
|
2023-11-08 20:38:57 +04:00
|
|
|
(elfeed-protocol-enable)
|
|
|
|
)
|
|
|
|
|
|
|
|
(let* ((proto-id "fever+https://sako@rss.sako.box")
|
|
|
|
(last-id (elfeed-protocol-fever-get-update-mark proto-id 'update)))
|
|
|
|
(elfeed-protocol-fever-set-update-mark proto-id 'update (- last-id 1000)))
|
|
|
|
|
|
|
|
(run-at-time 300 300
|
|
|
|
(lambda () (when (= elfeed-curl-queue-active 0)
|
|
|
|
(elfeed-update))))
|
|
|
|
|
|
|
|
(add-hook 'emacs-startup-hook (elfeed-update))
|
|
|
|
|
2023-12-24 13:32:15 +04:00
|
|
|
;; codeberg thingy
|
|
|
|
(use-package visual-fill-column)
|
2023-12-24 15:52:42 +04:00
|
|
|
(use-package telega)
|
2023-11-29 18:16:24 +04:00
|
|
|
|
2023-12-22 19:00:42 +04:00
|
|
|
(use-package pdf-tools
|
|
|
|
:straight t
|
|
|
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
|
|
|
:config
|
|
|
|
(setq-default pdf-view-display-size 'fit-page)
|
2023-11-29 18:16:24 +04:00
|
|
|
:init
|
2023-12-22 19:00:42 +04:00
|
|
|
(pdf-tools-install))
|
|
|
|
|
|
|
|
(use-package ement
|
|
|
|
:straight t)
|
2023-11-29 18:16:24 +04:00
|
|
|
|
2023-12-23 20:46:19 +04:00
|
|
|
;; global defaults
|
|
|
|
;; (use-package mu4e
|
|
|
|
;; :custom
|
|
|
|
;; mu4e-update-interval 300
|
|
|
|
;; )
|
|
|
|
|
|
|
|
;; we need this regardless of platform
|
|
|
|
(use-package smtpmail
|
|
|
|
:straight t)
|
|
|
|
|
2023-09-08 23:17:37 +04:00
|
|
|
(org-babel-do-load-languages
|
|
|
|
'org-babel-load-languages
|
|
|
|
'((emacs-lisp . t)
|
|
|
|
(python . t)))
|
|
|
|
|
|
|
|
(defun sakomacs/org-babel-tangle-config ()
|
|
|
|
(when (string-equal (buffer-file-name)
|
|
|
|
(expand-file-name "~/nixos/config/emacs/emacs.org"))
|
|
|
|
(let ((org-confirm-babel-evaluate nil))
|
|
|
|
(org-babel-tangle)))
|
|
|
|
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'sakomacs/org-babel-tangle-config))))
|
2023-09-15 19:06:09 +04:00
|
|
|
|
|
|
|
(defun sakomacs/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-history-size 10000
|
|
|
|
eshell-buffer-maximum-lines 10000
|
|
|
|
eshell-hist-ignoredups t
|
|
|
|
eshell-scroll-to-bottom-on-input t))
|
|
|
|
|
|
|
|
(use-package eshell-git-prompt)
|
|
|
|
|
|
|
|
(use-package eshell
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-09-15 19:06:09 +04:00
|
|
|
:hook (eshell-first-time-mode . sakomacs/configure-eshell)
|
|
|
|
:config
|
|
|
|
|
|
|
|
(with-eval-after-load 'esh-opt
|
|
|
|
(setq eshell-destroy-buffer-when-process-dies t)
|
|
|
|
(setq eshell-visual-commands '("htop" "zsh" "vim")))
|
|
|
|
|
|
|
|
(eshell-git-prompt-use-theme 'powerline))
|
2023-10-04 07:32:31 +04:00
|
|
|
|
|
|
|
(use-package vterm
|
2023-11-29 18:16:24 +04:00
|
|
|
:straight t
|
2023-10-04 07:32:31 +04:00
|
|
|
:commands vterm
|
|
|
|
:config
|
|
|
|
(setq vterm-max-scrollback 10000))
|
2023-11-29 18:16:24 +04:00
|
|
|
|
|
|
|
(require 'notifications)
|
|
|
|
|
|
|
|
(if (eq system-type 'windows-nt)
|
|
|
|
(w32-notification-notify
|
|
|
|
:title "Emacs Daemon"
|
|
|
|
:body "The Emacs Daemon has started"))
|
|
|
|
|
|
|
|
(if (eq system-type 'gnu/linux)
|
|
|
|
(notifications-notify
|
|
|
|
:title "Emacs Daemon"
|
|
|
|
:body "The Emacs Daemon has started"))
|
|
|
|
|
|
|
|
|
|
|
|
(message "Emacs is ready")
|