Compare commits

...

2 Commits

Author SHA1 Message Date
1b43d053f0 home: emacs: add olivetti and nyan-mode 2025-10-18 18:08:38 +05:30
4335805701 home: emacs some more changes
- Fix benchmark-deactivate on init
- defer loading aidermacs and gptel
- also set evil-want-keybinding to nil: https://github.com/emacs-evil/evil-collection/issues/6
2025-10-18 18:08:07 +05:30

View File

@@ -58,8 +58,7 @@
#+begin_src emacs-lisp
(use-package benchmark-init
:config
;; To disable collection of benchmark data after init is done.
:init (benchmark-init/deactivate))
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
#+end_src
** Visual packages
@@ -139,6 +138,7 @@ Consult
(use-package evil
:init
(setq-default evil-shift-width 2)
(setq evil-want-keybinding nil)
:config
(evil-set-initial-state 'vterm-mode 'insert)
(evil-set-undo-system 'undo-tree)
@@ -235,7 +235,6 @@ For autocomplete
(add-to-list 'company-backends 'company-dabbrev)
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
:hook (after-init . global-company-mode))
#+end_src
*** Configure company-quickhelp
@@ -358,24 +357,64 @@ Do not use centaur tabs for now
#+end_src
** Misc packages
#+begin_src emacs-lisp
*** Icons
For installing icons
#+begin_src emacs-lisp
(use-package all-the-icons
:defer t
:if (display-graphic-p))
#+end_src
(use-package elcord :defer t)
*** Projectile
For tracking project root
#+begin_src emacs-lisp
(use-package projectile
:defer t
:config
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
(projectile-mode +1))
#+end_src
*** Rainbow
For highlighting colors
#+begin_src emacs-lisp
(use-package rainbow-mode :defer t)
#+end_src
*** Rainbow delimiters
To make distinguishing parens easier
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
#+end_src
*** Olivetti
When you want write prose or something similar
#+begin_src emacs-lisp
(use-package olivetti
:defer t
:diminish olivetti-mode
:custom
(olivetti-body-width 100)
(olivetti-minimum-body-width 50)
(olivetti-style 'fancy)
(olivetti-recall-visual-line-mode-entry-state t)
:config
(defvar-local my/olivetti--saved-line-numbers nil
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
(defun my/olivetti-toggle-line-numbers ()
"Hide line numbers when entering Olivetti, restore when exiting."
(if olivetti-mode
(progn
(setq my/olivetti--saved-line-numbers display-line-numbers)
(setq display-line-numbers nil))
(setq display-line-numbers my/olivetti--saved-line-numbers)))
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
#+end_src
** Org
** Add org-mode
#+begin_src emacs-lisp
@@ -433,13 +472,26 @@ Do not use centaur tabs for now
* Random eye candy stuff
* Custom mode line
* Mode line
** Doom modeline
switched to doom modeline after using my own modeline for a while
#+begin_src emacs-lisp
(use-package doom-modeline
:init (doom-modeline-mode 1))
#+end_src
#+begin_src emacs-lisp
(use-package nyan-mode
:ensure t
:init
(when (display-graphic-p)
(nyan-mode 1))
:custom
(nyan-animate-nyancat t)
:config
(nyan-start-animation))
#+end_src
* Pop-up terminal
Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post
#+begin_src emacs-lisp
@@ -488,6 +540,7 @@ Compilation shortcuts for standalone files
** gptel
#+begin_src emacs-lisp
(use-package gptel
:defer t
:config
(setq gptel-model 'claude-sonnet-4-20250514
gptel-backend (gptel-make-anthropic "Claude"
@@ -503,6 +556,7 @@ Compilation shortcuts for standalone files
** Aidermacs
#+begin_src emacs-lisp
(use-package aidermacs
:defer t
:bind (("C-c a" . aidermacs-transient-menu))
:custom
; See the Configuration section below