From 1b72441d141505f80a4657f46c63693fd8a000ee Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 21 Sep 2023 03:20:43 -0700 Subject: [PATCH] A bunch of changes --- init.el | 95 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 26 deletions(-) diff --git a/init.el b/init.el index 875fa16..5c2a4fb 100644 --- a/init.el +++ b/init.el @@ -30,6 +30,7 @@ ;; diminish (use-package diminish :config + (diminish 'visual-line-mode) (diminish 'abbrev-mode)) ;; basic stuff @@ -79,6 +80,9 @@ ;; No scroll bars (scroll-bar-mode -1) + ;; Some better scrolling + (pixel-scroll-mode 1) + ;; Visual line mode (global-visual-line-mode 1) @@ -87,9 +91,7 @@ ;; Some settings for programming (setq-default indent-tabs-mode nil - tab-width 4 - c-basic-offset 4 - indent-line-function 'insert-tab) + tab-width 4) ;; Tree sitter download locations (setq treesit-language-source-alist @@ -101,9 +103,18 @@ ;; Tree sitter major mode conversions (setq major-mode-remap-alist '((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) (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 :config (recentf-mode 1)) @@ -114,21 +125,27 @@ (setq evil-want-integration t evil-want-keybinding nil evil-undo-system 'undo-redo - evil-search-module 'isearch) + evil-search-module 'isearch) :config (evil-mode 1) (evil-define-key '(normal visual motion) proced-mode-map - "u" #'proced-unmark) + "u" #'proced-unmark) (evil-define-key '(normal visual motion) dired-mode-map - "u" #'dired-unmark)) + "u" #'dired-unmark)) (use-package evil-collection :diminish evil-collection-unimpaired-mode :config (evil-collection-init)) (use-package evil-surround :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)) -(use-package evil-terminal-cursor-changer +(use-package evil-terminal-cursor-changer :config (evil-terminal-cursor-changer-activate)) @@ -149,8 +166,8 @@ visual states." :keymap (make-sparse-keymap)) (evil-define-key '(normal visual operator motion) my/evil-avy-mode-map - "s" #'evil-avy-goto-char-2 - "S" #'evil-avy-goto-line) + "s" #'evil-avy-goto-char-2 + "S" #'evil-avy-goto-line) (define-globalized-minor-mode my/evil-avy-global-mode my/evil-avy-mode (lambda () (my/evil-avy-mode 1)) :predicate '((not magit-mode dired-mode proced-mode) t)) @@ -180,14 +197,14 @@ visual states." ("RET" . vertico-directory-enter) ("DEL" . vertico-directory-delete-char) ("M-DEL" . vertico-directory-delete-word)) + :hook (minibuffer-setup . cursor-intangible-mode) :init (setq vertico-cycle t enable-recursive-minibuffers t read-extended-command-predicate #'command-completion-default-include-p minibuffer-prompt-properties '(read-only t - cursor-intangible t - face minibuffer-prompt)) - (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) + cursor-intangible t + face minibuffer-prompt)) (vertico-mode 1)) ;; orderless @@ -213,20 +230,20 @@ visual states." ;; marginalia (use-package marginalia :bind (:map minibuffer-local-map - ("M-a" . marginalia-cycle)) + ("M-a" . marginalia-cycle)) :init (marginalia-mode 1)) ;; embark (use-package embark :bind (("C-." . embark-act) - ("C-;" . embark-dwim)) + ("C-;" . embark-dwim)) :init (setq embark-quit-after-action nil) (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" - nil - (window-parameters (mode-line-format . none))))) + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) ;; consult (use-package consult @@ -244,7 +261,10 @@ visual states." ("M-g i" . consult-imenu) ("M-g I" . consult-imenu-multi) ("M-g r" . consult-imenu-multi)) + :hook (minibuffer-setup . my/consult-setup-minibuffer-completion) :init + (defun my/consult-setup-minibuffer-completion () + (setq-local completion-in-region-function #'consult-completion-in-region)) (defun my/consult-emacs-info () "`consult-info' for emacs specific pages." (interactive) @@ -295,9 +315,9 @@ visual states." (use-package xref :init (evil-define-key '(normal motion) 'global - "gr" #'xref-find-references) + "gr" #'xref-find-references) (setq xref-show-xrefs-function #'consult-xref - xref-show-definitions-function #'consult-xref)) + xref-show-definitions-function #'consult-xref)) ;; popup.el (use-package popup) @@ -328,7 +348,7 @@ visual states." ;; eglot (use-package eglot :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)) :init (defun my/-eglot-setup () @@ -361,19 +381,19 @@ visual states." :ensure nil :init (evil-define-key '(normal visual motion) dired-mode-map - "u" #'dired-unmark - "U" #'dired-unmark-all-marks) + "u" #'dired-unmark + "U" #'dired-unmark-all-marks) (evil-define-key '(normal visual motion) wdired-mode-map - "u" #'dired-unmark - "U" #'dired-unmark-all-marks)) + "u" #'dired-unmark + "U" #'dired-unmark-all-marks)) ;; magit (use-package magit :bind ("C-x C-m" . magit) :init (evil-define-key '(normal visual motion) magit-mode-map - "s" #'magit-stage-file - "S" #'magit-stage-modified)) + "s" #'magit-stage-file + "S" #'magit-stage-modified)) ;; rainbow-delimiters (use-package rainbow-delimiters @@ -389,3 +409,26 @@ visual states." (use-package solaire-mode :config (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))