137 lines
3.7 KiB
Nix
137 lines
3.7 KiB
Nix
{pkgs, ...}:
|
|
|
|
{
|
|
xdg.configFile."emacs/init.el".text = ''
|
|
(setq gc-cons-threshold most-positive-fixnum)
|
|
(add-hook 'emacs-startup-hook
|
|
(lambda ()
|
|
(setq gc-cons-threshold (expt 2 23))))
|
|
|
|
;; Install straight.el
|
|
(defvar bootstrap-version)
|
|
(let ((bootstrap-file
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
(bootstrap-version 6))
|
|
(unless (file-exists-p bootstrap-file)
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
'silent 'inhibit-cookies)
|
|
(goto-char (point-max))
|
|
(eval-print-last-sexp)))
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
(straight-use-package 'use-package)
|
|
|
|
(when (fboundp 'windmove-default-keybindings)
|
|
(windmove-default-keybindings))
|
|
|
|
(use-package straight
|
|
:custom
|
|
(straight-use-package-by-default t))
|
|
|
|
(use-package evil)
|
|
(use-package doom-themes
|
|
:config
|
|
(load-theme 'doom-dracula t))
|
|
(use-package doom-modeline)
|
|
(use-package dashboard)
|
|
(use-package nerd-icons)
|
|
(use-package all-the-icons
|
|
:if (display-graphic-p))
|
|
|
|
(use-package hl-indent-scope)
|
|
|
|
(use-package centaur-tabs
|
|
:demand
|
|
:config
|
|
(centaur-tabs-mode t)
|
|
:custom
|
|
(centaur-tabs-style "box")
|
|
(centaur-tabs-set-bar 'under)
|
|
(centaur-tabs-set-icons t)
|
|
|
|
(centaur-tabs-height 32)
|
|
(centaur-tabs-set-modified-marker t)
|
|
(centaur-tabs-cycle-scope 'tabs)
|
|
:bind
|
|
("C-<tab>" . centaur-tabs-forward)
|
|
("C-<iso-lefttab>" . centaur-tabs-backward))
|
|
|
|
(use-package dashboard)
|
|
(use-package envrc)
|
|
|
|
(use-package lsp-ui
|
|
:custom (lsp-ui-sideline-show-diagnostics t))
|
|
(use-package lsp-mode
|
|
:custom
|
|
(lsp-headerline-breadcrumb-enable nil))
|
|
|
|
(use-package nix-mode :mode "\\.nix\\'")
|
|
(use-package rust-mode)
|
|
(use-package lua-mode)
|
|
(use-package typescript-mode)
|
|
(use-package astro-ts-mode)
|
|
(use-package js2-mode)
|
|
(use-package svelte-mode)
|
|
(use-package lsp-java)
|
|
(use-package markdown-mode
|
|
:ensure t)
|
|
|
|
(envrc-global-mode)
|
|
|
|
(use-package company)
|
|
(use-package flycheck :ensure t :init (global-flycheck-mode))
|
|
(use-package treesit-auto
|
|
:demand t
|
|
:config
|
|
(global-treesit-auto-mode))
|
|
|
|
(require 'treesit)
|
|
(setq treesit-font-lock-settings t)
|
|
(add-to-list 'major-mode-remap-alist '(typescript-mode . typescript-ts-mode))
|
|
|
|
(setq treesit-language-source-alist
|
|
'((astro "https://github.com/virchau13/tree-sitter-astro")
|
|
(css "https://github.com/tree-sitter/tree-sitter-css")
|
|
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))
|
|
|
|
(set-face-attribute 'default nil :font "victor mono" :height 120)
|
|
|
|
(tool-bar-mode -1)
|
|
(menu-bar-mode -1)
|
|
(scroll-bar-mode -1)
|
|
(display-line-numbers-mode 1)
|
|
|
|
(doom-modeline-mode 1)
|
|
(evil-mode 1)
|
|
|
|
(add-hook 'after-init-hook 'global-company-mode)
|
|
|
|
(dashboard-setup-startup-hook)
|
|
(centaur-tabs-headline-match)
|
|
|
|
|
|
(setq x-underline-at-descent-line t)
|
|
(setq dashboard-banner-logo-title "Gock and Gum")
|
|
(setq inhibit-splash-screen t)
|
|
(setq warning-minimum-level :error)
|
|
|
|
(setq org-startup-with-inline-images t)
|
|
(setq org-startup-indented t)
|
|
(setq org-pretty-entities t)
|
|
|
|
(setq dashboard-startup-banner nil)
|
|
(setq doom-modeline-height 25)
|
|
(setq backup-directory-alist '(("." . "~/.config/emacs/backup")))
|
|
|
|
;; No more typing the whole yes or no. Just y or n will do.
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
(evil-ex-define-cmd "q" 'kill-current-buffer)
|
|
(defun kill-this-buffer()(interactive)(kill-current-buffer))
|
|
|
|
(evil-ex-define-cmd "wq" 'save-and-kill-this-buffer)
|
|
(defun save-and-kill-this-buffer()(interactive)(save-buffer)(kill-current-buffer))
|
|
'';
|
|
}
|