2021-12-22 17:23:38 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.within.emacs;
|
|
|
|
in {
|
2023-01-12 20:57:35 +00:00
|
|
|
options.within.emacs.enable =
|
|
|
|
mkEnableOption "emacs without spacemacs support";
|
2023-01-15 03:48:17 +00:00
|
|
|
imports = [ ./emacs-init.nix ./emacs-init-defaults.nix ];
|
2021-12-22 17:23:38 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.file."bin/e" = {
|
|
|
|
text = ''
|
|
|
|
#!/bin/sh
|
2023-02-02 19:00:12 +00:00
|
|
|
exec emacsclient -a "" -nc $@
|
2021-12-22 17:23:38 +00:00
|
|
|
'';
|
|
|
|
executable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.emacs = {
|
|
|
|
enable = true;
|
2023-06-10 14:30:13 +00:00
|
|
|
package = pkgs.emacs-unstable-nox;
|
2021-12-22 17:23:38 +00:00
|
|
|
|
|
|
|
init = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
recommendedGcSettings = true;
|
|
|
|
|
2022-12-09 17:53:10 +00:00
|
|
|
prelude = ''
|
2021-12-22 17:23:38 +00:00
|
|
|
(require 'bind-key)
|
|
|
|
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
|
|
|
(menu-bar-mode -1)
|
2023-02-04 18:04:14 +00:00
|
|
|
(tab-bar-mode 1)
|
2021-12-22 17:23:38 +00:00
|
|
|
|
|
|
|
(electric-pair-mode)
|
|
|
|
|
|
|
|
(recentf-mode 1)
|
|
|
|
(setq recentf-max-menu-items 25)
|
|
|
|
(setq recentf-max-saved-items 25)
|
|
|
|
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
|
|
|
|
|
|
|
|
(when window-system
|
|
|
|
(dolist (mode
|
|
|
|
'(tool-bar-mode
|
|
|
|
tooltip-mode
|
|
|
|
scroll-bar-mode
|
|
|
|
menu-bar-mode
|
|
|
|
blink-cursor-mode))
|
|
|
|
(funcall mode 0)))
|
|
|
|
|
|
|
|
(add-hook 'text-mode-hook 'auto-fill-mode)
|
|
|
|
|
|
|
|
(setq delete-old-versions -1 ) ; delete excess backup versions silently
|
|
|
|
(setq version-control t ) ; use version control
|
|
|
|
(setq vc-make-backup-files t ) ; make backups file even when in version controlled dir
|
|
|
|
(setq backup-directory-alist `(("." . "~/.emacs.d/backups")) ) ; which directory to put backups file
|
|
|
|
(setq vc-follow-symlinks t ) ; don't ask for confirmation when opening symlinked file
|
|
|
|
(setq auto-save-file-name-transforms '((".*" "~/.emacs.d/auto-save-list/" t)) ) ;transform backups file name
|
|
|
|
(setq inhibit-startup-screen t ) ; inhibit useless and old-school startup screen
|
|
|
|
(setq ring-bell-function 'ignore ) ; silent bell when you make a mistake
|
|
|
|
(setq coding-system-for-read 'utf-8 ) ; use utf-8 by default
|
|
|
|
(setq coding-system-for-write 'utf-8 )
|
|
|
|
(setq sentence-end-double-space nil) ; sentence SHOULD end with only a point.
|
|
|
|
(setq default-fill-column 80) ; toggle wrapping text at the 80th character
|
|
|
|
|
|
|
|
(defun chomp (str)
|
|
|
|
"Chomp leading and tailing whitespace from STR."
|
|
|
|
(while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'"
|
|
|
|
str)
|
|
|
|
(setq str (replace-match "" t t str)))
|
|
|
|
str)
|
2023-01-12 20:57:35 +00:00
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
(defun eshell/e (arg)
|
|
|
|
"opens a given file in emacs from eshell"
|
|
|
|
(find-file arg))
|
|
|
|
|
|
|
|
(defun eshell/eh (arg)
|
|
|
|
"opens a file in emacs from shell horizontally"
|
|
|
|
(split-window-vertically)
|
|
|
|
(other-window 1)
|
|
|
|
(find-file arg))
|
|
|
|
|
|
|
|
(defun eshell/ev (arg)
|
|
|
|
"opens a file in emacs from shell vertically"
|
|
|
|
(split-window-horizontally)
|
|
|
|
(other-window 1)
|
|
|
|
(find-file arg))
|
|
|
|
|
2023-01-23 17:56:41 +00:00
|
|
|
;;;; Mouse scrolling in terminal emacs
|
|
|
|
(unless (display-graphic-p)
|
|
|
|
;; activate mouse-based scrolling
|
|
|
|
(xterm-mouse-mode 1)
|
|
|
|
(global-set-key (kbd "<mouse-4>") 'scroll-down-line)
|
|
|
|
(global-set-key (kbd "<mouse-5>") 'scroll-up-line))
|
2023-02-22 02:51:38 +00:00
|
|
|
|
|
|
|
;; git gutter with tramp
|
|
|
|
(defun git-gutter+-remote-default-directory (dir file)
|
|
|
|
(let* ((vec (tramp-dissect-file-name file))
|
|
|
|
(method (tramp-file-name-method vec))
|
|
|
|
(user (tramp-file-name-user vec))
|
|
|
|
(domain (tramp-file-name-domain vec))
|
|
|
|
(host (tramp-file-name-host vec))
|
|
|
|
(port (tramp-file-name-port vec)))
|
|
|
|
(tramp-make-tramp-file-name method user domain host port dir)))
|
|
|
|
|
|
|
|
(defun git-gutter+-remote-file-path (dir file)
|
|
|
|
(let ((file (tramp-file-name-localname (tramp-dissect-file-name file))))
|
|
|
|
(replace-regexp-in-string (concat "\\`" dir) "" file)))
|
2021-12-22 17:23:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
usePackageVerbose = true;
|
|
|
|
|
|
|
|
usePackage = {
|
2023-01-12 20:57:35 +00:00
|
|
|
# core packages
|
|
|
|
better-defaults.enable = true;
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
company = {
|
|
|
|
enable = true;
|
|
|
|
diminish = [ "company-mode" ];
|
|
|
|
config = ''
|
|
|
|
(company-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
counsel = {
|
|
|
|
enable = true;
|
|
|
|
|
2023-01-15 03:45:00 +00:00
|
|
|
bindStar = {
|
2021-12-22 17:23:38 +00:00
|
|
|
"M-x" = "counsel-M-x";
|
|
|
|
"C-x C-f" = "counsel-find-file";
|
|
|
|
"C-x C-r" = "counsel-recentf";
|
|
|
|
"C-c f" = "counsel-git";
|
|
|
|
"C-c s" = "counsel-git-grep";
|
|
|
|
"C-c /" = "counsel-rg";
|
|
|
|
"C-c l" = "counsel-locate";
|
|
|
|
"M-y" = "counsel-yank-pop";
|
|
|
|
};
|
2023-01-15 03:44:55 +00:00
|
|
|
|
|
|
|
general = ''
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"SPC" '(counsel-M-x :which-key "M-x")
|
|
|
|
"ff" '(counsel-find-file :which-key "find file")
|
|
|
|
"s" '(:ignore t :which-key "search")
|
|
|
|
"sc" '(counsel-unicode-char :which-key "find character"))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-02-22 02:51:38 +00:00
|
|
|
crontab-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [
|
|
|
|
''("\\.cron\\(tab\\)?\\'" . crontab-mode)''
|
|
|
|
''("cron\\(tab\\)?\\." . crontab-mode)''
|
|
|
|
''("/cron.d/" . crontab-mode)''
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-01-25 02:35:17 +00:00
|
|
|
dashboard = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(dashboard-setup-startup-hook)
|
|
|
|
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
|
|
|
|
(setq dashboard-banner-logo-title "Have you ever been far even as decided to use even go want to do look more like?")
|
2023-02-04 17:17:16 +00:00
|
|
|
;(add-to-list 'dashboard-items '(agenda) t)
|
2023-02-04 18:04:14 +00:00
|
|
|
;(setq dashboard-week-agenda t)
|
2023-01-25 02:35:17 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
direnv = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(direnv-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
evil = {
|
|
|
|
enable = true;
|
|
|
|
init = ''
|
|
|
|
(setq evil-want-C-i-jump nil)
|
2023-02-22 02:51:38 +00:00
|
|
|
(setq evil-want-keybinding nil)
|
2021-12-22 17:23:38 +00:00
|
|
|
'';
|
|
|
|
config = ''
|
|
|
|
(evil-mode 1)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
evil-surround = {
|
|
|
|
enable = true;
|
2023-02-22 02:51:38 +00:00
|
|
|
after = [ "evil" ];
|
2021-12-22 17:23:38 +00:00
|
|
|
config = ''
|
|
|
|
(global-evil-surround-mode 1)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
evil-collection = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "evil" ];
|
|
|
|
};
|
|
|
|
|
2023-01-15 03:44:55 +00:00
|
|
|
evil-magit = {
|
|
|
|
enable = true;
|
2023-02-22 02:51:38 +00:00
|
|
|
after = [ "evil" "magit" ];
|
2023-01-15 03:44:55 +00:00
|
|
|
};
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
flycheck = {
|
|
|
|
enable = true;
|
|
|
|
diminish = [ "flycheck-mode" ];
|
|
|
|
config = ''
|
|
|
|
(global-flycheck-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
lsp-mode = {
|
|
|
|
enable = true;
|
|
|
|
command = [ "lsp" ];
|
|
|
|
hook = [
|
|
|
|
"(go-mode . lsp)"
|
|
|
|
"(rust-mode . lsp)"
|
|
|
|
"(lsp-mode . lsp-enable-which-key-integration)"
|
|
|
|
];
|
|
|
|
config = ''
|
|
|
|
(setq lsp-rust-server 'rust-analyzer)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
lsp-ui = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "lsp" ];
|
|
|
|
command = [ "lsp-ui-mode" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
lsp-ivy = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "lsp" "ivy" ];
|
|
|
|
command = [ "lsp-ivy-workspace-symbol" ];
|
|
|
|
};
|
|
|
|
|
2023-02-22 02:51:38 +00:00
|
|
|
git-gutter = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(global-git-gutter-mode +1)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
general = {
|
|
|
|
enable = true;
|
2023-01-15 03:44:55 +00:00
|
|
|
after = [ "evil" "which-key" ];
|
2021-12-22 17:23:38 +00:00
|
|
|
config = ''
|
2023-01-15 03:44:55 +00:00
|
|
|
(general-evil-setup)
|
|
|
|
|
|
|
|
(general-mmap
|
|
|
|
":" 'evil-ex
|
|
|
|
";" 'evil-repeat-find-char)
|
|
|
|
|
|
|
|
(general-create-definer my-leader-def
|
|
|
|
:prefix "SPC")
|
|
|
|
|
|
|
|
(general-create-definer my-local-leader-def
|
|
|
|
:prefix "SPC m")
|
|
|
|
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"b" '(:ignore t :which-key "buffer")
|
|
|
|
"bd" '(kill-this-buffer :which-key "kill buffer")
|
|
|
|
|
|
|
|
"f" '(:ignore t :which-key "file")
|
|
|
|
"ff" '(find-file :which-key "find")
|
|
|
|
"fs" '(save-buffer :which-key "save")
|
|
|
|
|
|
|
|
"m" '(:ignore t :which-key "mode")
|
|
|
|
|
|
|
|
"t" '(:ignore t :which-key "toggle")
|
|
|
|
"tf" '(toggle-frame-fullscreen :which-key "fullscreen")
|
|
|
|
"wv" '(split-window-horizontally :which-key "split vertical")
|
|
|
|
"ws" '(split-window-vertically :which-key "split horizontal")
|
|
|
|
"wk" '(evil-window-up :which-key "up")
|
|
|
|
"wj" '(evil-window-down :which-key "down")
|
|
|
|
"wh" '(evil-window-left :which-key "left")
|
|
|
|
"wl" '(evil-window-right :which-key "right")
|
|
|
|
"wd" '(delete-window :which-key "delete")
|
|
|
|
|
|
|
|
"q" '(:ignore t :which-key "quit")
|
|
|
|
"qq" '(save-buffers-kill-emacs :which-key "quit"))
|
2021-12-22 17:23:38 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-01-23 17:56:41 +00:00
|
|
|
fountain-mode = {
|
|
|
|
enable = true;
|
2023-05-15 15:20:06 +00:00
|
|
|
mode = [ ''("\\.fountain\\'" . fountain-mode)'' ];
|
2023-01-23 17:56:41 +00:00
|
|
|
};
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
ivy = {
|
|
|
|
enable = true;
|
|
|
|
demand = true;
|
|
|
|
diminish = [ "ivy-mode" ];
|
|
|
|
config = ''
|
|
|
|
(ivy-mode 1)
|
|
|
|
(setq ivy-use-virtual-buffers t
|
2022-05-09 11:39:47 +00:00
|
|
|
ivy-hight 25
|
2021-12-22 17:23:38 +00:00
|
|
|
ivy-count-format "(%d/%d) "
|
|
|
|
ivy-initial-inputs-alist nil)
|
|
|
|
'';
|
2023-01-15 03:44:55 +00:00
|
|
|
general = ''
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"bb" '(ivy-switch-buffer :which-key "switch buffer")
|
|
|
|
"fr" '(ivy-recentf :which-key "recent file"))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-15 03:44:55 +00:00
|
|
|
magit = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
general = ''
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"g" '(:ignore t :which-key "Git")
|
|
|
|
"gs" 'magit-status)
|
|
|
|
'';
|
|
|
|
};
|
2021-12-22 17:23:38 +00:00
|
|
|
|
|
|
|
markdown-mode = {
|
|
|
|
enable = true;
|
|
|
|
command = [ "markdown-mode" "gfm-mode" ];
|
|
|
|
mode = [
|
|
|
|
''("README\\.md\\'" . gfm-mode)''
|
|
|
|
''("\\.md\\'" . markdown-mode)''
|
2023-01-23 17:47:41 +00:00
|
|
|
''("\\.mdx\\'" . markdown-mode)''
|
2021-12-22 17:23:38 +00:00
|
|
|
''("\\.markdown\\'" . markdown-mode)''
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
projectile = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "ivy" ];
|
|
|
|
diminish = [ "projectile-mode" ];
|
|
|
|
config = ''
|
|
|
|
(projectile-mode 1)
|
|
|
|
(progn
|
|
|
|
(setq projectile-enable-caching t)
|
|
|
|
(setq projectile-require-project-root nil)
|
|
|
|
(setq projectile-completion-system 'ivy)
|
|
|
|
(add-to-list 'projectile-globally-ignored-files ".DS_Store"))
|
|
|
|
'';
|
2023-01-15 03:44:55 +00:00
|
|
|
general = ''
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"p" '(:ignore t :which-key "Project")
|
|
|
|
"pf" '(projectile-find-file :which-key "Find in project")
|
|
|
|
"pl" '(projectile-switch-project :which-key "Switch project"))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-13 21:40:10 +00:00
|
|
|
rainbow-delimiters = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
swiper = {
|
|
|
|
enable = true;
|
|
|
|
|
2023-01-15 03:45:00 +00:00
|
|
|
bindStar = { "C-s" = "swiper"; };
|
2023-01-15 03:44:55 +00:00
|
|
|
|
|
|
|
general = ''
|
|
|
|
(general-nmap
|
|
|
|
:prefix "SPC"
|
|
|
|
"ss" '(swiper :which-key "swiper"))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-02-03 15:59:11 +00:00
|
|
|
vterm.enable = true;
|
|
|
|
|
2021-12-22 17:23:38 +00:00
|
|
|
which-key = {
|
|
|
|
enable = true;
|
|
|
|
diminish = [ "which-key-mode" ];
|
|
|
|
config = ''
|
|
|
|
(which-key-mode)
|
|
|
|
(which-key-setup-side-window-right-bottom)
|
|
|
|
(setq which-key-sort-order 'which-key-key-order-alpha
|
|
|
|
which-key-side-window-max-width 0.33
|
|
|
|
which-key-idle-delay 0.05)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
gruvbox-theme = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(setq custom-safe-themes t)
|
2023-01-16 15:06:36 +00:00
|
|
|
(add-hook 'after-init-hook (lambda () (load-theme 'gruvbox-dark-soft t)))
|
2021-12-22 17:23:38 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
nov = {
|
2021-12-22 17:23:38 +00:00
|
|
|
enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
mode = [ ''"\\.epub\\'"'' ];
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
web-mode = {
|
2021-12-22 17:23:38 +00:00
|
|
|
enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
mode = [ ''"\\.html\\'"'' ''"\\.tmpl\\'"'' ];
|
2023-01-19 18:32:48 +00:00
|
|
|
config = ''
|
|
|
|
(define-derived-mode typescript-tsx-mode web-mode "TypeScript-tsx")
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
# org-mode
|
|
|
|
org = {
|
2021-12-22 17:23:38 +00:00
|
|
|
enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
config = ''
|
|
|
|
(setq org-agenda-files '("~/org/daily/" "~/org/"))
|
2021-12-22 17:23:38 +00:00
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
(setq org-capture-templates '(("c" "Contacts" entry (file "~/org/contacts.org")
|
|
|
|
"* %(org-contacts-template-name)\n:PROPERTIES:\n:EMAIL: %(org-contacts-template-email)\n:END:")))
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
org-journal = {
|
2021-12-22 17:23:38 +00:00
|
|
|
enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
config = ''
|
|
|
|
(setq org-journal-dir "~/org/daily/")
|
|
|
|
(setq org-journal-date-prefix "#+startup: logdrawer\n#+options: d:t\n#+TITLE: ")
|
|
|
|
(setq org-journal-file-format "%Y%m%d.org")
|
|
|
|
(setq org-journal-time-prefix "* ")
|
|
|
|
(setq org-journal-time-format "TODO ")
|
|
|
|
(setq org-journal-enable-agenda-integration t)
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
org-roam = {
|
2021-12-22 17:23:38 +00:00
|
|
|
enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
config = ''
|
|
|
|
(setq org-roam-directory "~/org/roam")
|
|
|
|
'';
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ob.enable = true;
|
|
|
|
org-download.enable = true;
|
|
|
|
org-mime.enable = true;
|
|
|
|
org-pomodoro.enable = true;
|
|
|
|
org-projectile.enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
org-contacts.enable = true;
|
|
|
|
ox-epub.enable = true;
|
|
|
|
org-roam-ui.enable = true;
|
|
|
|
org-roam-protocol.enable = true;
|
2021-12-22 17:23:38 +00:00
|
|
|
|
|
|
|
systemd.enable = true;
|
2022-05-09 11:39:47 +00:00
|
|
|
|
|
|
|
gemini-mode.enable = true;
|
|
|
|
"0x0".enable = true;
|
2023-01-12 20:57:35 +00:00
|
|
|
request.enable = true;
|
2022-05-14 15:56:37 +00:00
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
# programming languages
|
|
|
|
cython-mode.enable = true;
|
|
|
|
dockerfile-mode.enable = true;
|
|
|
|
nix.enable = true;
|
|
|
|
protobuf-mode.enable = true;
|
|
|
|
terraform-mode.enable = true;
|
2023-01-19 16:08:48 +00:00
|
|
|
|
|
|
|
## typescript
|
|
|
|
js2-mode.enable = true;
|
|
|
|
#rjsx-mode.enable = true;
|
2022-05-14 15:56:37 +00:00
|
|
|
tide.enable = true;
|
2023-01-23 17:56:41 +00:00
|
|
|
typescript-mode = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(setq typescript-indent-level 2)
|
|
|
|
'';
|
|
|
|
};
|
2023-01-19 17:38:55 +00:00
|
|
|
|
2023-01-25 15:39:58 +00:00
|
|
|
add-node-modules-path = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(eval-after-load 'js2-mode
|
|
|
|
'(add-hook 'js2-mode-hook #'add-node-modules-path))
|
|
|
|
(eval-after-load 'typescript-mode
|
|
|
|
'(add-hook 'typescript-mode-hook #'add-node-modules-path))
|
|
|
|
(eval-after-load 'web-mode
|
|
|
|
'(add-hook 'web-mode-hook #'add-node-modules-path))
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
prettier-js = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "xe-tools" ];
|
|
|
|
config = ''
|
|
|
|
(add-hook 'js2-mode-hook 'prettier-js-mode)
|
|
|
|
(add-hook 'web-mode-hook 'prettier-js-mode)
|
|
|
|
|
|
|
|
(add-hook 'web-mode-hook #'(lambda ()
|
|
|
|
(xe/enable-minor-mode
|
|
|
|
'("\\.jsx?\\'" . prettier-js-mode))))
|
|
|
|
(add-hook 'web-mode-hook #'(lambda ()
|
|
|
|
(xe/enable-minor-mode
|
|
|
|
'("\\.tsx?\\'" . prettier-js-mode))))
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-05-14 15:56:37 +00:00
|
|
|
deno-fmt = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(add-hook 'typescript-mode-hook 'deno-fmt-mode)
|
|
|
|
(add-hook 'js2-mode-hook 'deno-fmt-mode)
|
|
|
|
'';
|
|
|
|
};
|
2023-01-12 20:57:35 +00:00
|
|
|
|
|
|
|
go-mode = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(setq gofmt-command "goimports")
|
2023-02-05 13:57:43 +00:00
|
|
|
(add-hook 'before-save-hook #'gofmt-before-save)
|
2023-01-12 20:57:35 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-02-22 02:51:38 +00:00
|
|
|
highlight-indent-guides = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
nix-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.nix\\'"'' ];
|
|
|
|
bindLocal = { nix-mode-map = { "C-i" = "nix-indent-line"; }; };
|
|
|
|
};
|
|
|
|
|
2023-01-25 02:35:17 +00:00
|
|
|
nixpkgs-fmt = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(add-hook 'nix-mode-hook 'nixpkgs-fmt-on-save-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
nix-prettify-mode = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
(nix-prettify-global-mode)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
nix-drv-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.drv\\'"'' ];
|
|
|
|
};
|
|
|
|
|
2023-02-25 13:12:38 +00:00
|
|
|
haskell-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.hs\\'"'' ];
|
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
dhall-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.dhall\\'"'' ];
|
|
|
|
};
|
|
|
|
|
|
|
|
moonscript = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.moon\\'"'' ];
|
|
|
|
};
|
|
|
|
|
|
|
|
rust-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.rs\\'"'' ];
|
|
|
|
};
|
|
|
|
|
|
|
|
toml-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.toml\\'"'' ];
|
|
|
|
};
|
|
|
|
|
2023-05-15 15:20:06 +00:00
|
|
|
typst-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.typ\\'"'' ];
|
|
|
|
};
|
|
|
|
|
2023-01-12 20:57:35 +00:00
|
|
|
zig-mode = {
|
|
|
|
enable = true;
|
|
|
|
mode = [ ''"\\.zig\\'"'' ];
|
|
|
|
};
|
2023-01-23 16:30:18 +00:00
|
|
|
|
2023-05-15 15:20:06 +00:00
|
|
|
shell-maker.enable = true;
|
|
|
|
|
2023-01-23 16:30:18 +00:00
|
|
|
## custom shit
|
2023-02-22 02:51:38 +00:00
|
|
|
change-case = {
|
|
|
|
enable = true;
|
2023-05-15 15:20:06 +00:00
|
|
|
package = (epkgs:
|
|
|
|
epkgs.trivialBuild {
|
|
|
|
pname = "change-case";
|
|
|
|
src = ./packages/change-case.el;
|
|
|
|
});
|
2023-02-22 02:51:38 +00:00
|
|
|
};
|
2023-03-03 01:37:32 +00:00
|
|
|
|
|
|
|
tclip = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "request" ];
|
2023-05-15 15:20:06 +00:00
|
|
|
package = (epkgs:
|
|
|
|
epkgs.trivialBuild {
|
|
|
|
pname = "tclip";
|
|
|
|
src = ./packages/tclip.el;
|
|
|
|
packageRequires = [ epkgs.request ];
|
|
|
|
});
|
2023-03-03 01:37:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
xe-chatgpt = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "request" ];
|
2023-05-15 15:20:06 +00:00
|
|
|
package = (epkgs:
|
|
|
|
epkgs.trivialBuild {
|
|
|
|
pname = "xe-chatgpt";
|
|
|
|
src = ./packages/xe-chatgpt.el;
|
|
|
|
packageRequires = [ epkgs.request ];
|
|
|
|
});
|
2023-03-03 01:37:32 +00:00
|
|
|
};
|
2023-05-15 15:20:06 +00:00
|
|
|
|
2023-01-23 16:30:18 +00:00
|
|
|
xe-tools = {
|
|
|
|
enable = true;
|
2023-05-15 15:20:06 +00:00
|
|
|
package = (epkgs:
|
|
|
|
epkgs.trivialBuild {
|
|
|
|
pname = "xe-tools";
|
|
|
|
src = ./packages/xe-tools.el;
|
|
|
|
});
|
2023-02-04 18:04:14 +00:00
|
|
|
|
2023-02-22 02:51:38 +00:00
|
|
|
config = ''
|
|
|
|
(setq linum-format 'xe/linum-format-func)
|
|
|
|
(global-linum-mode)
|
|
|
|
'';
|
|
|
|
|
2023-02-04 18:04:14 +00:00
|
|
|
bindStar = {
|
|
|
|
"C-a c" = "xe/tabnew-shell";
|
|
|
|
"C-a h" = "split-window-vertically";
|
|
|
|
"C-a v" = "split-window-horizontally";
|
|
|
|
};
|
2023-01-23 16:30:18 +00:00
|
|
|
};
|
2021-12-22 17:23:38 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|