more stuff and things

This commit is contained in:
Mars 2024-08-13 22:31:54 -04:00
parent 9a84223cfd
commit 65e5a4d1c4
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
3 changed files with 65 additions and 204 deletions

View file

@ -1,160 +0,0 @@
; Fixes "Symbol's value as variable is void: personal-keybindings" error
(require 'bind-key)
; Disable bars
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
; Vim-style scrolling
(setq scroll-step 3
scroll-margin 3
scroll-conservatively 9999)
; Set titlebar for macOS
(when (eq system-type 'darwin)
(ns-auto-titlebar-mode))
; Set font size depending on the system type
(cond
((eq system-type 'darwin)
(set-frame-font "Maple Mono NF 16" nil t))
((eq system-type 'gnu/linux)
(set-frame-font "Maple Mono NF 12" nil t)))
; Set theme
(use-package catppuccin-theme :ensure t :demand t)
(load-theme 'catppuccin t)
; Set modeline
(use-package doom-modeline
:ensure t
:hook (after-init . doom-modeline-mode))
; Emoji support
(use-package emojify
:hook (after-init . global-emojify-mode))
; Undo tree
(use-package undo-tree
:demand t
:config
(global-undo-tree-mode)
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))))
; Evil mode
(use-package evil
:ensure t
:init
(setq evil-want-integration t) ;; This is optional since it's already set to t by default.
(setq evil-want-keybinding nil)
(setq evil-undo-system 'undo-tree)
:config
(evil-mode 1))
;; Evil collection
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
;; Evil leader
(use-package evil-leader
:after evil
:config
(global-evil-leader-mode)
(setq evil-leader/leader "<SPC>") ;; Set the leader key to space
(evil-leader/set-key "a" #'eglot-code-actions)
(evil-leader/set-key "e" #'treemacs))
; Dashboard
(use-package dashboard
:ensure t
:config
(dashboard-setup-startup-hook)
(setq dashboard-startup-banner 'logo))
(defun dashboard-recentf-filter (file)
"Add to ~recentf-exclude~ to filter recent files in dashboard buffer."
(when (eq (get-buffer dashboard-buffer-name)
(current-buffer))
(string-match "treemacs-persist$" file)))
(add-to-list 'recentf-exclude 'dashboard-recentf-filter)
; Direnv
(use-package direnv
:config
(direnv-mode))
; Nix
(use-package nix-mode
:mode "\\.nix\\'")
; Treesitter
(use-package tree-sitter
:hook ((prog-mode . tree-sitter-mode)
(prog-mode . tree-sitter-hl-mode)))
(use-package tree-sitter-langs)
(use-package treesit-auto
:config
(global-treesit-auto-mode)
(dolist (lang treesit-language-source-alist)
(let ((mode (intern (format "%s-ts-mode" (car lang)))))
(when (fboundp mode)
(add-to-list 'major-mode-remap-alist
(cons (intern (car lang)) mode))))))
; Eglot setup
(add-hook 'prog-mode-hook 'eglot-ensure)
(evil-leader/set-key
"a" #'eglot-code-actions)
;; Function to format the buffer using Eglot
(defun my/eglot-format-buffer-on-save ()
"Format the current buffer if Eglot is active."
(when (bound-and-true-p eglot--managed-p)
(eglot-format-buffer)))
;; Add the function to the save-hook
(add-hook 'before-save-hook #'my/eglot-format-buffer-on-save)
; Flycheck
(use-package flycheck
:ensure t
:config
(add-hook 'after-init-hook #'global-flycheck-mode))
; Sideline
(use-package sideline-flycheck
:hook (flycheck-mode . sideline-mode)
:init (setq sideline-backends-right '(sideline-flycheck)
sideline-delay 0.0))
(use-package sideline-flycheck
:hook (flycheck-mode . sideline-flycheck-setup)
:init (setq sideline-flycheck-display-mode 'line))
; Eglot
(use-package sideline-eglot
:init
(setq sideline-backends-right '(sideline-eglot)))
(use-package eglot :hook (eglot-mode . sideline-mode)) ; enable it when eglot is on
; Centaur tabs
(use-package centaur-tabs
:demand t
:config
(centaur-tabs-mode t)
(setq centaur-tabs-style "wave")
:bind
("C-<prior>" . centaur-tabs-backward)
("C-<next>" . centaur-tabs-forward))
(use-package vterm-toggle :ensure t)
(global-set-key [C-t] 'vterm-toggle)

View file

@ -13,7 +13,7 @@
(unless (server-running-p) (server-start)) (unless (server-running-p) (server-start))
#+end_src #+end_src
** Disable UI Elements ** Disable Bars
#+begin_src emacs-lisp #+begin_src emacs-lisp
(menu-bar-mode -1) (menu-bar-mode -1)
@ -42,6 +42,12 @@
(setq default-frame-alist '((font . "Maple Mono NF-12"))))) (setq default-frame-alist '((font . "Maple Mono NF-12")))))
#+end_src #+end_src
** Use Short Answers
#+begin_src emacs-lisp
(setq use-short-answers t)
#+end_src emacs-lisp
* Package Management * Package Management
** Theme ** Theme
@ -77,8 +83,7 @@
** Emoji Support ** Emoji Support
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package emojify (use-package emojify :hook (after-init . global-emojify-mode))
:hook (after-init . global-emojify-mode))
#+end_src #+end_src
** Undo Tree ** Undo Tree
@ -96,57 +101,56 @@
** Direnv ** Direnv
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package direnv (use-package direnv :config (direnv-mode))
:config
(direnv-mode))
#+end_src #+end_src
** Nix ** Nix
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package nix-mode (use-package nix-mode :mode "\\.nix\\'")
:mode "\\.nix\\'")
#+end_src #+end_src
** Treesitter ** Treesitter
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package treesit-auto (use-package treesit-auto
:requires treesit :requires treesit
:config :config
(setq treesit-auto-install 'prompt) (setq treesit-auto-install 'prompt)
(global-treesit-auto-mode)) (global-treesit-auto-mode))
(use-package treesit (use-package treesit
:requires treesit :requires treesit
:ensure nil :ensure nil
:config :config
(mapc #'exordium--add-forward-ts-hook (mapc #'exordium--add-forward-ts-hook
'( '(
LaTeX LaTeX
bash bash
c c
c++ c++
cmake cmake
csharp csharp
css css
go elisp
go-mod go
java go-mod
js java
json js
markdown json
python markdown
ruby python
rust ruby
scala rust
toml scala
typescript toml
yaml typescript
)) yaml
))
(setq treesit-font-lock-level 4)) (setq treesit-font-lock-level 4))
(use-package tree-sitter-langs) (use-package tree-sitter-langs)
(use-package tree-sitter (use-package tree-sitter
:diminish :diminish
:after (tree-sitter-langs) :after (tree-sitter-langs)
@ -156,11 +160,11 @@
(font-lock-maximum-decoration t) (font-lock-maximum-decoration t)
:config :config
(when-let ((language-name (alist-get 'ruby-mode (when-let ((language-name (alist-get 'ruby-mode
tree-sitter-major-mode-language-alist))) tree-sitter-major-mode-language-alist)))
(add-to-list 'tree-sitter-major-mode-language-alist (add-to-list 'tree-sitter-major-mode-language-alist
(cons 'enh-ruby-mode language-name))) (cons 'enh-ruby-mode language-name)))
(add-to-list 'tree-sitter-major-mode-language-alist (add-to-list 'tree-sitter-major-mode-language-alist
(cons 'forge-post-mode 'markdown)) (cons 'forge-post-mode 'markdown))
(global-tree-sitter-mode)) (global-tree-sitter-mode))
#+end_src #+end_src
@ -177,6 +181,17 @@
(add-hook 'before-save-hook #'my/eglot-format-buffer-on-save) (add-hook 'before-save-hook #'my/eglot-format-buffer-on-save)
#+end_src #+end_src
** Corfu Completions
#+begin_src emacs-lisp
(use-package corfu
:custom
(corfu-cycle t)
(corfu-preselect 'prompt)
:init
(global-corfu-mode))
#+end_src
** Flycheck ** Flycheck
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -192,7 +207,7 @@
(use-package sideline-flycheck (use-package sideline-flycheck
:hook (flycheck-mode . sideline-mode) :hook (flycheck-mode . sideline-mode)
:init (setq sideline-backends-right '(sideline-flycheck) :init (setq sideline-backends-right '(sideline-flycheck)
sideline-delay 0.0)) sideline-delay 0.0))
(use-package sideline-flycheck (use-package sideline-flycheck
:hook (flycheck-mode . sideline-flycheck-setup) :hook (flycheck-mode . sideline-flycheck-setup)
@ -220,10 +235,14 @@
(use-package evil (use-package evil
:ensure t :ensure t
:init :init
(setq evil-want-integration t) (setq evil-split-window-below t)
(setq evil-want-C-u-scroll t)
(setq evil-want-keybinding nil)
(setq evil-undo-system 'undo-tree) (setq evil-undo-system 'undo-tree)
(setq evil-vsplit-window-right t)
(setq evil-want-C-i-jump nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-integration t)
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
:config :config
(evil-mode 1)) (evil-mode 1))
#+end_src #+end_src
@ -267,7 +286,8 @@
:config :config
(centaur-tabs-mode t) (centaur-tabs-mode t)
(setq centaur-tabs-style "wave") (setq centaur-tabs-style "wave")
(setq centaur-tabs-cycle-scope 'tabs)
:bind :bind
("C-<prior>" . centaur-tabs-backward) ("C-<tab>" . centaur-tabs-forward)
("C-<next>" . centaur-tabs-forward)) ("C-S-<tab>" . centaur-tabs-backward))
#+end_src #+end_src

View file

@ -21,7 +21,7 @@
config.allowUnfree = true; config.allowUnfree = true;
overlays = [emacs-overlay.overlay]; overlays = [emacs-overlay.overlay];
}; };
in { in rec {
formatter = treefmt-nix.lib.mkWrapper pkgs { formatter = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs = { programs = {
@ -35,6 +35,7 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
packages.default
alejandra alejandra
nvfetcher nvfetcher
stylua stylua