more stuff and things
This commit is contained in:
parent
9a84223cfd
commit
65e5a4d1c4
160
config/init.el
160
config/init.el
|
@ -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)
|
106
config/init.org
106
config/init.org
|
@ -13,7 +13,7 @@
|
|||
(unless (server-running-p) (server-start))
|
||||
#+end_src
|
||||
|
||||
** Disable UI Elements
|
||||
** Disable Bars
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(menu-bar-mode -1)
|
||||
|
@ -42,6 +42,12 @@
|
|||
(setq default-frame-alist '((font . "Maple Mono NF-12")))))
|
||||
#+end_src
|
||||
|
||||
** Use Short Answers
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq use-short-answers t)
|
||||
#+end_src emacs-lisp
|
||||
|
||||
* Package Management
|
||||
|
||||
** Theme
|
||||
|
@ -77,8 +83,7 @@
|
|||
** Emoji Support
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package emojify
|
||||
:hook (after-init . global-emojify-mode))
|
||||
(use-package emojify :hook (after-init . global-emojify-mode))
|
||||
#+end_src
|
||||
|
||||
** Undo Tree
|
||||
|
@ -96,57 +101,56 @@
|
|||
** Direnv
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package direnv
|
||||
:config
|
||||
(direnv-mode))
|
||||
(use-package direnv :config (direnv-mode))
|
||||
#+end_src
|
||||
|
||||
** Nix
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package nix-mode
|
||||
:mode "\\.nix\\'")
|
||||
(use-package nix-mode :mode "\\.nix\\'")
|
||||
#+end_src
|
||||
|
||||
** Treesitter
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treesit-auto
|
||||
:requires treesit
|
||||
:config
|
||||
(setq treesit-auto-install 'prompt)
|
||||
(global-treesit-auto-mode))
|
||||
:requires treesit
|
||||
:config
|
||||
(setq treesit-auto-install 'prompt)
|
||||
(global-treesit-auto-mode))
|
||||
|
||||
(use-package treesit
|
||||
:requires treesit
|
||||
:ensure nil
|
||||
:config
|
||||
(mapc #'exordium--add-forward-ts-hook
|
||||
'(
|
||||
LaTeX
|
||||
bash
|
||||
c
|
||||
c++
|
||||
cmake
|
||||
csharp
|
||||
css
|
||||
go
|
||||
go-mod
|
||||
java
|
||||
js
|
||||
json
|
||||
markdown
|
||||
python
|
||||
ruby
|
||||
rust
|
||||
scala
|
||||
toml
|
||||
typescript
|
||||
yaml
|
||||
))
|
||||
'(
|
||||
LaTeX
|
||||
bash
|
||||
c
|
||||
c++
|
||||
cmake
|
||||
csharp
|
||||
css
|
||||
elisp
|
||||
go
|
||||
go-mod
|
||||
java
|
||||
js
|
||||
json
|
||||
markdown
|
||||
python
|
||||
ruby
|
||||
rust
|
||||
scala
|
||||
toml
|
||||
typescript
|
||||
yaml
|
||||
))
|
||||
(setq treesit-font-lock-level 4))
|
||||
|
||||
(use-package tree-sitter-langs)
|
||||
|
||||
(use-package tree-sitter
|
||||
:diminish
|
||||
:after (tree-sitter-langs)
|
||||
|
@ -156,11 +160,11 @@
|
|||
(font-lock-maximum-decoration t)
|
||||
:config
|
||||
(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
|
||||
(cons 'enh-ruby-mode language-name)))
|
||||
(cons 'enh-ruby-mode language-name)))
|
||||
(add-to-list 'tree-sitter-major-mode-language-alist
|
||||
(cons 'forge-post-mode 'markdown))
|
||||
(cons 'forge-post-mode 'markdown))
|
||||
(global-tree-sitter-mode))
|
||||
#+end_src
|
||||
|
||||
|
@ -177,6 +181,17 @@
|
|||
(add-hook 'before-save-hook #'my/eglot-format-buffer-on-save)
|
||||
#+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
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
@ -192,7 +207,7 @@
|
|||
(use-package sideline-flycheck
|
||||
:hook (flycheck-mode . sideline-mode)
|
||||
:init (setq sideline-backends-right '(sideline-flycheck)
|
||||
sideline-delay 0.0))
|
||||
sideline-delay 0.0))
|
||||
|
||||
(use-package sideline-flycheck
|
||||
:hook (flycheck-mode . sideline-flycheck-setup)
|
||||
|
@ -220,10 +235,14 @@
|
|||
(use-package evil
|
||||
:ensure t
|
||||
:init
|
||||
(setq evil-want-integration t)
|
||||
(setq evil-want-C-u-scroll t)
|
||||
(setq evil-want-keybinding nil)
|
||||
(setq evil-split-window-below t)
|
||||
(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
|
||||
(evil-mode 1))
|
||||
#+end_src
|
||||
|
@ -267,7 +286,8 @@
|
|||
:config
|
||||
(centaur-tabs-mode t)
|
||||
(setq centaur-tabs-style "wave")
|
||||
(setq centaur-tabs-cycle-scope 'tabs)
|
||||
:bind
|
||||
("C-<prior>" . centaur-tabs-backward)
|
||||
("C-<next>" . centaur-tabs-forward))
|
||||
("C-<tab>" . centaur-tabs-forward)
|
||||
("C-S-<tab>" . centaur-tabs-backward))
|
||||
#+end_src
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
config.allowUnfree = true;
|
||||
overlays = [emacs-overlay.overlay];
|
||||
};
|
||||
in {
|
||||
in rec {
|
||||
formatter = treefmt-nix.lib.mkWrapper pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
|
@ -35,6 +35,7 @@
|
|||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
packages.default
|
||||
alejandra
|
||||
nvfetcher
|
||||
stylua
|
||||
|
|
Loading…
Reference in a new issue