A bunch of changes

This commit is contained in:
Alexander Rosenberg 2023-09-21 03:20:43 -07:00
parent 62bd3e312d
commit 1b72441d14
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

95
init.el
View File

@ -30,6 +30,7 @@
;; diminish ;; diminish
(use-package diminish (use-package diminish
:config :config
(diminish 'visual-line-mode)
(diminish 'abbrev-mode)) (diminish 'abbrev-mode))
;; basic stuff ;; basic stuff
@ -79,6 +80,9 @@
;; No scroll bars ;; No scroll bars
(scroll-bar-mode -1) (scroll-bar-mode -1)
;; Some better scrolling
(pixel-scroll-mode 1)
;; Visual line mode ;; Visual line mode
(global-visual-line-mode 1) (global-visual-line-mode 1)
@ -87,9 +91,7 @@
;; Some settings for programming ;; Some settings for programming
(setq-default indent-tabs-mode nil (setq-default indent-tabs-mode nil
tab-width 4 tab-width 4)
c-basic-offset 4
indent-line-function 'insert-tab)
;; Tree sitter download locations ;; Tree sitter download locations
(setq treesit-language-source-alist (setq treesit-language-source-alist
@ -101,9 +103,18 @@
;; Tree sitter major mode conversions ;; Tree sitter major mode conversions
(setq major-mode-remap-alist (setq major-mode-remap-alist
'((c-mode . c-ts-mode) '((c-mode . c-ts-mode)
(c++-mode . c++-ts-mode)
(c-or-c++-mode . c-or-c++-ts-mode)
(objc-mode . objc-ts-mode)
(java-mode . java-ts-mode) (java-mode . java-ts-mode)
(rust-mode . rust-ts-mode)))) (rust-mode . rust-ts-mode))))
;; c-ts-mode
(use-package c-ts-mode
:init
(setq-default c-ts-mode-indent-offset 4))
;; recentf
(use-package recentf (use-package recentf
:config :config
(recentf-mode 1)) (recentf-mode 1))
@ -114,21 +125,27 @@
(setq evil-want-integration t (setq evil-want-integration t
evil-want-keybinding nil evil-want-keybinding nil
evil-undo-system 'undo-redo evil-undo-system 'undo-redo
evil-search-module 'isearch) evil-search-module 'isearch)
:config :config
(evil-mode 1) (evil-mode 1)
(evil-define-key '(normal visual motion) proced-mode-map (evil-define-key '(normal visual motion) proced-mode-map
"u" #'proced-unmark) "u" #'proced-unmark)
(evil-define-key '(normal visual motion) dired-mode-map (evil-define-key '(normal visual motion) dired-mode-map
"u" #'dired-unmark)) "u" #'dired-unmark))
(use-package evil-collection (use-package evil-collection
:diminish evil-collection-unimpaired-mode :diminish evil-collection-unimpaired-mode
:config :config
(evil-collection-init)) (evil-collection-init))
(use-package evil-surround (use-package evil-surround
:config :config
(evil-define-key 'operator evil-surround-mode-map
"z" #'evil-surround-edit
"Z" #'evil-Sunrround-edit)
(evil-define-key 'visual evil-surround-mode-map
"g z" #'evil-surround-region
"g Z" #'evil-Surround-region)
(global-evil-surround-mode 1)) (global-evil-surround-mode 1))
(use-package evil-terminal-cursor-changer (use-package evil-terminal-cursor-changer
:config :config
(evil-terminal-cursor-changer-activate)) (evil-terminal-cursor-changer-activate))
@ -149,8 +166,8 @@
visual states." visual states."
:keymap (make-sparse-keymap)) :keymap (make-sparse-keymap))
(evil-define-key '(normal visual operator motion) my/evil-avy-mode-map (evil-define-key '(normal visual operator motion) my/evil-avy-mode-map
"s" #'evil-avy-goto-char-2 "s" #'evil-avy-goto-char-2
"S" #'evil-avy-goto-line) "S" #'evil-avy-goto-line)
(define-globalized-minor-mode my/evil-avy-global-mode my/evil-avy-mode (define-globalized-minor-mode my/evil-avy-global-mode my/evil-avy-mode
(lambda () (my/evil-avy-mode 1)) (lambda () (my/evil-avy-mode 1))
:predicate '((not magit-mode dired-mode proced-mode) t)) :predicate '((not magit-mode dired-mode proced-mode) t))
@ -180,14 +197,14 @@ visual states."
("RET" . vertico-directory-enter) ("RET" . vertico-directory-enter)
("DEL" . vertico-directory-delete-char) ("DEL" . vertico-directory-delete-char)
("M-DEL" . vertico-directory-delete-word)) ("M-DEL" . vertico-directory-delete-word))
:hook (minibuffer-setup . cursor-intangible-mode)
:init :init
(setq vertico-cycle t (setq vertico-cycle t
enable-recursive-minibuffers t enable-recursive-minibuffers t
read-extended-command-predicate #'command-completion-default-include-p read-extended-command-predicate #'command-completion-default-include-p
minibuffer-prompt-properties '(read-only t minibuffer-prompt-properties '(read-only t
cursor-intangible t cursor-intangible t
face minibuffer-prompt)) face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
(vertico-mode 1)) (vertico-mode 1))
;; orderless ;; orderless
@ -213,20 +230,20 @@ visual states."
;; marginalia ;; marginalia
(use-package marginalia (use-package marginalia
:bind (:map minibuffer-local-map :bind (:map minibuffer-local-map
("M-a" . marginalia-cycle)) ("M-a" . marginalia-cycle))
:init :init
(marginalia-mode 1)) (marginalia-mode 1))
;; embark ;; embark
(use-package embark (use-package embark
:bind (("C-." . embark-act) :bind (("C-." . embark-act)
("C-;" . embark-dwim)) ("C-;" . embark-dwim))
:init :init
(setq embark-quit-after-action nil) (setq embark-quit-after-action nil)
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil nil
(window-parameters (mode-line-format . none))))) (window-parameters (mode-line-format . none)))))
;; consult ;; consult
(use-package consult (use-package consult
@ -244,7 +261,10 @@ visual states."
("M-g i" . consult-imenu) ("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi) ("M-g I" . consult-imenu-multi)
("M-g r" . consult-imenu-multi)) ("M-g r" . consult-imenu-multi))
:hook (minibuffer-setup . my/consult-setup-minibuffer-completion)
:init :init
(defun my/consult-setup-minibuffer-completion ()
(setq-local completion-in-region-function #'consult-completion-in-region))
(defun my/consult-emacs-info () (defun my/consult-emacs-info ()
"`consult-info' for emacs specific pages." "`consult-info' for emacs specific pages."
(interactive) (interactive)
@ -295,9 +315,9 @@ visual states."
(use-package xref (use-package xref
:init :init
(evil-define-key '(normal motion) 'global (evil-define-key '(normal motion) 'global
"gr" #'xref-find-references) "gr" #'xref-find-references)
(setq xref-show-xrefs-function #'consult-xref (setq xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref)) xref-show-definitions-function #'consult-xref))
;; popup.el ;; popup.el
(use-package popup) (use-package popup)
@ -328,7 +348,7 @@ visual states."
;; eglot ;; eglot
(use-package eglot (use-package eglot
:hook (((c-ts-mode c++-ts-mode java-ts-mode rust-ts-mode :hook (((c-ts-mode c++-ts-mode java-ts-mode rust-ts-mode
python-ts-mode) . eglot-ensure) python-ts-mode latex-mode) . eglot-ensure)
(eglot-managed-mode . my/-eglot-setup)) (eglot-managed-mode . my/-eglot-setup))
:init :init
(defun my/-eglot-setup () (defun my/-eglot-setup ()
@ -361,19 +381,19 @@ visual states."
:ensure nil :ensure nil
:init :init
(evil-define-key '(normal visual motion) dired-mode-map (evil-define-key '(normal visual motion) dired-mode-map
"u" #'dired-unmark "u" #'dired-unmark
"U" #'dired-unmark-all-marks) "U" #'dired-unmark-all-marks)
(evil-define-key '(normal visual motion) wdired-mode-map (evil-define-key '(normal visual motion) wdired-mode-map
"u" #'dired-unmark "u" #'dired-unmark
"U" #'dired-unmark-all-marks)) "U" #'dired-unmark-all-marks))
;; magit ;; magit
(use-package magit (use-package magit
:bind ("C-x C-m" . magit) :bind ("C-x C-m" . magit)
:init :init
(evil-define-key '(normal visual motion) magit-mode-map (evil-define-key '(normal visual motion) magit-mode-map
"s" #'magit-stage-file "s" #'magit-stage-file
"S" #'magit-stage-modified)) "S" #'magit-stage-modified))
;; rainbow-delimiters ;; rainbow-delimiters
(use-package rainbow-delimiters (use-package rainbow-delimiters
@ -389,3 +409,26 @@ visual states."
(use-package solaire-mode (use-package solaire-mode
:config :config
(solaire-global-mode 1)) (solaire-global-mode 1))
;; icons
(use-package nerd-icons)
(use-package nerd-icons-completion
:config
(nerd-icons-completion-mode))
(use-package nerd-icons-dired
:hook (dired-mode . nerd-icons-dired-mode))
(use-package kind-icon
:after corfu
:init
(setq kind-icon-default-face 'corfu-default
kind-icon-default-style
'(:padding -1 :stroke 0 :margin 0 :radius 0 :height 0.5 :scale 1))
:config
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
;; modeline (doom-modeline)
(use-package doom-modeline
:init
(setq doom-modeline-support-imenu t)
(doom-modeline-mode 1))