2024-10-20 10:17:15 +03:00
|
|
|
(let ((indent 4))
|
2024-03-07 20:17:35 +02:00
|
|
|
(setq standard-indent indent)
|
2024-03-08 12:36:38 +02:00
|
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
(setq-default tab-width 2)
|
|
|
|
(setq c-basic-offset indent))
|
2024-08-26 22:34:37 +03:00
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
2024-03-07 16:57:57 +02:00
|
|
|
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
|
|
|
|
(setq inferior-lisp-program "sbcl")
|
2024-03-07 20:17:35 +02:00
|
|
|
(defun font-size-to-height (size) (* 10 size))
|
|
|
|
(let ((font-size 14))
|
|
|
|
(set-face-attribute 'default nil :height (font-size-to-height font-size)))
|
2024-03-07 16:57:57 +02:00
|
|
|
(setq mastodon-instance-url "https://shonk.phite.ro"
|
|
|
|
mastodon-active-user "graphite")
|
2024-10-20 10:17:15 +03:00
|
|
|
;(evil-mode 1)
|
2024-03-07 20:17:35 +02:00
|
|
|
(add-hook 'lisp-mode 'parinfer-rust-mode)
|
2024-03-07 16:57:57 +02:00
|
|
|
(require 'bshell)
|
|
|
|
(add-hook 'eshell-load-hook #'eat-eshell-mode)
|
|
|
|
(add-hook 'eshell-load-hook #'eat-eshell-visual-command-mode)
|
|
|
|
; (load (expand-file-name "~/.emacs.d/everblush-theme.el"))
|
2024-10-20 10:17:15 +03:00
|
|
|
; (load-theme 'uwu)
|
2024-03-07 16:57:57 +02:00
|
|
|
(if (window-system)
|
2024-08-26 22:34:37 +03:00
|
|
|
(set-frame-size (selected-frame) 1000 800))
|
2024-03-07 20:17:35 +02:00
|
|
|
;; (add-hook 'c++-mode-hook 'irony-mode)
|
|
|
|
;; (add-hook 'c-mode-hook 'irony-mode)
|
|
|
|
;; (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'parinfer-rust-mode)
|
|
|
|
|
|
|
|
;(push 'hotfuzz completion-styles)
|
|
|
|
|
2024-08-26 22:34:37 +03:00
|
|
|
(setq vertico-cycle t)
|
2024-03-07 20:17:35 +02:00
|
|
|
(setq vertico-resize t)
|
2024-03-08 12:36:38 +02:00
|
|
|
(keymap-global-set "C-j" #'vertico-next-group)
|
|
|
|
(keymap-global-set "C-k" #'vertico-previous-group)
|
|
|
|
; (keymap-global-set "<tab>" #'vertico-insert)
|
|
|
|
(add-hook 'text-mode-hook (lambda ()
|
|
|
|
(keymap-set text-mode-map "<tab>" #'vertico-insert)))
|
2024-03-07 20:17:35 +02:00
|
|
|
(vertico-mode)
|
|
|
|
|
|
|
|
(savehist-mode)
|
|
|
|
|
|
|
|
(marginalia-mode 1)
|
|
|
|
|
|
|
|
|
2024-03-08 12:36:38 +02:00
|
|
|
(keymap-global-set "M-s M-g" #'consult-grep)
|
|
|
|
(keymap-global-set "M-s M-f" #'consult-find)
|
|
|
|
(keymap-global-set "M-s M-o" #'consult-outline)
|
|
|
|
(keymap-global-set "M-s M-l" #'consult-line)
|
|
|
|
(keymap-global-set "M-s M-b" #'consult-buffer)
|
|
|
|
(keymap-global-set "M-s M-m" #'consult-man)
|
2024-03-07 20:17:35 +02:00
|
|
|
|
2024-11-10 14:46:02 +02:00
|
|
|
(setq-default cursor-type 'bar)
|
2024-03-07 20:17:35 +02:00
|
|
|
|
|
|
|
(setq corfu-cycle t)
|
|
|
|
(setq corfu-auto t)
|
|
|
|
;(corfu-separator ?\s)
|
|
|
|
(global-corfu-mode)
|
2024-03-08 12:36:38 +02:00
|
|
|
|
|
|
|
(keymap-global-set "C-\\" #'eat)
|
|
|
|
|
2024-10-20 10:17:15 +03:00
|
|
|
;(add-hook 'eat-mode-hook (lambda () (evil-mode nil)))
|
|
|
|
;(evil-set-initial-state 'eat-mode 'emacs)
|
|
|
|
;(setq evil-move-beyond-eol t)
|
2024-03-08 12:36:38 +02:00
|
|
|
|
|
|
|
(recentf-mode 1)
|
|
|
|
(setq recentf-max-menu-items 25)
|
|
|
|
(setq recentf-max-saved-items 25)
|
|
|
|
(keymap-global-set "C-x C-r" #'recentf)
|
2024-04-07 23:18:48 +03:00
|
|
|
|
|
|
|
(use-package lambda-line
|
|
|
|
:straight (:type git :host github :repo "lambda-emacs/lambda-line")
|
|
|
|
:custom
|
|
|
|
(lambda-line-line-position 'bottom)
|
|
|
|
(lambda-line-abbrev t)
|
|
|
|
(lambda-line-hspace " ")
|
|
|
|
(lambda-line-prefix t)
|
|
|
|
(lambda-line-prefix-padding nil)
|
|
|
|
(lambda-line-status-invert nil)
|
|
|
|
(lambda-line-gui-ro-symbol " ⨂") ;; symbols
|
|
|
|
(lambda-line-gui-mod-symbol " ⬤")
|
|
|
|
(lambda-line-gui-rw-symbol " ◯")
|
|
|
|
:config
|
|
|
|
(lambda-line-mode)
|
|
|
|
(when (eq lambda-line-position 'top)
|
|
|
|
(setq-default mode-line-format (list "%_"))
|
|
|
|
(setq mode-line-format (list "%_"))))
|
|
|
|
|
|
|
|
;; tab bar
|
|
|
|
(setq-default tab-bar-show 1)
|
|
|
|
(tab-bar-mode)
|
|
|
|
|
|
|
|
;; doom-modeline
|
|
|
|
(doom-modeline-mode 1)
|
|
|
|
(setq doom-modeline-height 15)
|
|
|
|
|
|
|
|
;; treesitter
|
|
|
|
(add-hook 'c-mode-hook (c-ts-mode))
|
|
|
|
(add-hook 'c++-mode-hook (c++-ts-mode))
|
|
|
|
|
|
|
|
;; eglot
|
|
|
|
(with-eval-after-load 'eglot
|
|
|
|
(add-to-list 'eglot-server-programs
|
|
|
|
'(c-mode "/home/ultra/.nix-profile/bin/clangd")
|
|
|
|
'(c++-mode "/home/ultra/.nix-profile/bin/clangd")))
|
|
|
|
(add-hook 'c-mode-hook 'eglot-ensure)
|
|
|
|
(add-hook 'c-ts-mode-hook 'eglot-ensure)
|
|
|
|
(add-hook 'c++-ts-mode-hook 'eglot-ensure)
|
|
|
|
|
|
|
|
;; which-key
|
|
|
|
(which-key-setup-minibuffer)
|
|
|
|
(setq which-key-idle-delay 2000)
|
|
|
|
(setq which-key-idle-secondary-delay 0.05)
|
|
|
|
(which-key-mode)
|
|
|
|
|
2024-07-02 08:37:11 +03:00
|
|
|
(with-eval-after-load 'org
|
|
|
|
(require 'edraw-org)
|
|
|
|
(edraw-org-setup-default))
|
2024-07-02 11:44:52 +03:00
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
|
|
|
|
|
2024-08-26 22:34:37 +03:00
|
|
|
(add-hook 'prog-mode-hook 'rainbow-mode)
|
2024-04-07 23:18:48 +03:00
|
|
|
|
2024-07-03 11:06:03 +03:00
|
|
|
(add-hook 'eshell-mode-hook #'esh-autosuggest-mode)
|
2024-08-26 22:34:37 +03:00
|
|
|
;(define-key eshell-mode-map [remap eshell-pcomplete] 'helm-esh-pcomplete)
|
|
|
|
|
|
|
|
|
|
|
|
(dashboard-setup-startup-hook)
|
|
|
|
(add-hook 'server-after-make-frame-hook #'dashboard-open)
|
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook #'sublimity-mode)
|
|
|
|
|
2024-10-20 10:17:15 +03:00
|
|
|
;(add-hook 'prog-mode-hook #'linum-relative-on)
|
2024-08-26 22:34:37 +03:00
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
|
|
|
|
|
|
|
(setq completion-styles '(orderless basic)
|
|
|
|
completion-category-defaults nil
|
|
|
|
completion-category-overrides '((file (styles basic partial-completion))))
|
|
|
|
|
|
|
|
(setq pulsar-pulse t
|
|
|
|
pulsar-delay 0.055)
|
2024-10-20 10:17:15 +03:00
|
|
|
|
|
|
|
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
|
|
|
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
|
|
|
(require 'doom-themes)
|
|
|
|
(load-theme 'doom-tokyo-night)
|
|
|
|
(use-package kakoune
|
2024-11-10 14:46:02 +02:00
|
|
|
; :bind (("C-;" . ryo-modal-mode)
|
|
|
|
; ("C-z" . ryo-modal-mode)
|
|
|
|
; ("<escape>" . ryo-modal-mode))
|
|
|
|
:bind (("C-z" . ryo-modal-mode)
|
2024-10-20 10:17:15 +03:00
|
|
|
("<escape>" . ryo-modal-mode))
|
|
|
|
:hook (after-init . my/kakoune-setup)
|
2024-11-10 14:46:02 +02:00
|
|
|
:init (require 'bind-key)
|
2024-10-20 10:17:15 +03:00
|
|
|
:config
|
|
|
|
(defun ryo-enter () "Enter normal mode" (interactive) (ryo-modal-mode 1))
|
|
|
|
(defun my/kakoune-setup ()
|
|
|
|
"Call kakoune-setup-keybinds then add some personal config."
|
|
|
|
(kakoune-setup-keybinds)
|
2024-11-10 14:46:02 +02:00
|
|
|
(setq ryo-modal-cursor-type 'box)
|
|
|
|
(setq ryo-modal-cursor-color "#dadeff")
|
2024-10-20 10:17:15 +03:00
|
|
|
(add-hook 'prog-mode-hook #'ryo-enter)
|
|
|
|
(define-key ryo-modal-mode-map (kbd "SPC h") 'help-command)
|
|
|
|
;; Access all C-x bindings easily
|
|
|
|
(define-key ryo-modal-mode-map (kbd "z") ctl-x-map)
|
|
|
|
(ryo-modal-keys
|
|
|
|
("," save-buffer)
|
|
|
|
("p" counsel-yank-pop)
|
|
|
|
("m" mc/mark-next-like-this)
|
|
|
|
("M" mc/skip-to-next-like-this)
|
|
|
|
("n" mc/mark-previous-like-this)
|
|
|
|
("N" mc/skip-to-previous-like-this)
|
|
|
|
("M-m" mc/edit-lines)
|
|
|
|
("*" mc/mark-all-like-this)
|
|
|
|
("v" er/expand-region)
|
2024-11-10 14:46:02 +02:00
|
|
|
("/" phi-search)
|
2024-10-20 10:17:15 +03:00
|
|
|
("C-v" set-rectangular-region-anchor)
|
|
|
|
("M-s" mc/split-region)
|
|
|
|
(";" (("q" delete-window)
|
|
|
|
("v" split-window-horizontally)
|
|
|
|
("s" split-window-vertically)))
|
|
|
|
("C-h" windmove-left)
|
|
|
|
("C-j" windmove-down)
|
|
|
|
("C-k" windmove-up)
|
|
|
|
("C-l" windmove-right)
|
|
|
|
("C-u" scroll-down-command :first '(deactivate-mark))
|
|
|
|
("C-d" scroll-up-command :first '(deactivate-mark)))))
|
|
|
|
|
|
|
|
;; This overrides the default mark-in-region with a prettier-looking one,
|
|
|
|
;; and provides a couple extra commands
|
|
|
|
(use-package visual-regexp
|
|
|
|
:ryo
|
|
|
|
("s" vr/mc-mark)
|
|
|
|
("?" vr/replace)
|
|
|
|
("M-/" vr/query-replace))
|
|
|
|
|
|
|
|
;; Emacs incremental search doesn't work with multiple cursors, but this fixes that
|
|
|
|
(use-package phi-search
|
2024-11-10 14:46:02 +02:00
|
|
|
:init (require 'bind-key)
|
2024-10-20 10:17:15 +03:00
|
|
|
:bind (("C-s" . phi-search)
|
|
|
|
("C-r" . phi-search-backward)))
|
|
|
|
|
|
|
|
;; Probably the first thing you'd miss is undo and redo, which requires an extra package
|
|
|
|
;; to work like it does in kakoune (and almost every other editor).
|
|
|
|
(use-package undo-tree
|
|
|
|
:config
|
|
|
|
(global-undo-tree-mode)
|
|
|
|
:ryo
|
|
|
|
("u" undo-tree-undo)
|
|
|
|
("U" undo-tree-redo)
|
|
|
|
("SPC u" undo-tree-visualize)
|
|
|
|
:bind (:map undo-tree-visualizer-mode-map
|
|
|
|
("h" . undo-tree-visualize-switch-branch-left)
|
|
|
|
("j" . undo-tree-visualize-redo)
|
|
|
|
("k" . undo-tree-visualize-undo)
|
|
|
|
("l" . undo-tree-visualize-switch-branch-right)))
|
|
|
|
|
|
|
|
|