diff --git a/home/emacs/default.nix b/home/emacs/default.nix index ac984c7e..74984cf8 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -10,12 +10,8 @@ package = pkgs.emacs29-pgtk; extraPackages = epkgs: with epkgs; [ - # themes + # theme modus-themes - theme-magic - - # defaults-packages - god-mode # completion-packages cape @@ -28,6 +24,11 @@ orderless vertico + # snippets-packages + yasnippet + yasnippet-snippets + consult-yasnippet + # ide-packages vterm ibuffer-project @@ -60,7 +61,6 @@ # project-packages magit forge - git-timemachine # social-packages mastodon @@ -74,9 +74,7 @@ nerd-icons-ibuffer ligature page-break-lines - dashboard doom-modeline - centaur-tabs helpful which-key link-hint @@ -97,7 +95,6 @@ # feed-packages elfeed elfeed-org - elfeed-webkit elfeed-tube elfeed-tube-mpv ]; @@ -132,13 +129,21 @@ # Language-specific requirements sqlite pandoc - gfortran - rustup texlive.combined.scheme-full ghostscript mupdf - (python3.withPackages - (ps: with ps; [ python-lsp-server python-lsp-ruff pylsp-mypy ])) + gfortran + rustup + (python3.withPackages (ps: + with ps; [ + python-lsp-server + python-lsp-ruff + pylsp-mypy + numpy + scipy + matplotlib + xarray + ])) # Linters nodePackages.stylelint @@ -155,15 +160,13 @@ stylua python3Packages.mdformat html-tidy - nodePackages.js-beautify # LSP Servers - nixd + nil fortls shellcheck marksman luajitPackages.lua-lsp - # nodePackages.pyright nodePackages.yaml-language-server nodePackages.bash-language-server nodePackages.javascript-typescript-langserver diff --git a/home/emacs/init.el b/home/emacs/init.el index d00ba97d..9c6b3141 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -27,10 +27,10 @@ (global-auto-revert-mode +1) (delete-selection-mode) +(recentf-mode -1) ;; Misc useful keymaps (keymap-global-set "M-#" #'dictionary-lookup-definition) -(keymap-global-set "C-c r" #'recentf) (keymap-global-set "C-c b" #'ibuffer) (keymap-global-set "C-c p l" #'list-packages) (keymap-global-set "C-c p r" #'package-refresh-contents) @@ -229,36 +229,6 @@ :ensure t :config (doom-modeline-mode +1)) -;; Dashboard -(setq dashboard-icon-type 'nerd-icons - dashboard-set-heading-icons t - dashboard-set-file-icons t - dashboard-set-navigator t - dashboard-set-init-info t - dashboard-startup-banner 'ascii - dashboard-projects-backend 'project-el - dashboard-projects-switch-function 'project-switch-project - dashboard-projects-show-base t - dashboard-recentf-show-base 'align - dashboard-items '() - dashboard-banner-ascii (concat " .000000. \n" - " .0. .0. \n" - " .00. .00. \n" - " .000cl. .lc000. \n" - ".0 0.\n" - "0. .o0000o. .0\n" - " 00 .0' '0. 00 \n" - " 00 .0 0. 00 \n" - " HHHHH HHHHHHHHHHHH HHHHH \n" - "HHHH HHH HHHHHHHHHHHHHH HHHH\n" - " HHHHHH HHHHHHHHH HHHHHHHH \n" - " HHH HHHH HHHHHHHHH HHHH \n" - " HHH HHHHHH \n" - " HHHHH HH \n")) -(use-package dashboard - :ensure t - :config (setq initial-buffer-choice 'dashboard-open)) - (use-package darkroom :ensure t :bind (("C-c d" . darkroom-mode))) @@ -550,7 +520,6 @@ manually with something like this: (" " . consult-buffer) (" " . consult-project-buffer) (" " . consult-org-heading) - ("C-c s s" . consult-line) ("C-c s f" . consult-fd) ("C-c s g" . consult-ripgrep) ("C-c s e" . consult-flymake) @@ -570,6 +539,20 @@ manually with something like this: :after (embark consult) :hook (embark-collect-mode . consult-preview-at-point-mode)) +(use-package yasnippet + :ensure t + :hook ((prog-mode org-mode) . yas-minor-mode)) + +(use-package yasnippet-snippets + :ensure t + :after yasnippet + :config (yas-reload-all)) + +(use-package consult-yasnippet + :ensure t + :after (yasnippet consult) + :bind (("C-c s s" . consult-yasnippet))) + (unless (package-installed-p 'kbd-mode) (package-vc-install '(kbd-mode . (:url "https://github.com/kmonad/kbd-mode")))) diff --git a/home/emacs/init.org b/home/emacs/init.org index a251cea5..498fe66d 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -35,10 +35,10 @@ (global-auto-revert-mode +1) (delete-selection-mode) + (recentf-mode -1) ;; Misc useful keymaps (keymap-global-set "M-#" #'dictionary-lookup-definition) - (keymap-global-set "C-c r" #'recentf) (keymap-global-set "C-c b" #'ibuffer) (keymap-global-set "C-c p l" #'list-packages) (keymap-global-set "C-c p r" #'package-refresh-contents) @@ -264,39 +264,6 @@ :config (doom-modeline-mode +1)) #+end_src -** Dashboard -#+begin_src emacs-lisp - ;; Dashboard - (setq dashboard-icon-type 'nerd-icons - dashboard-set-heading-icons t - dashboard-set-file-icons t - dashboard-set-navigator t - dashboard-set-init-info t - dashboard-startup-banner 'ascii - dashboard-projects-backend 'project-el - dashboard-projects-switch-function 'project-switch-project - dashboard-projects-show-base t - dashboard-recentf-show-base 'align - dashboard-items '() - dashboard-banner-ascii (concat " .000000. \n" - " .0. .0. \n" - " .00. .00. \n" - " .000cl. .lc000. \n" - ".0 0.\n" - "0. .o0000o. .0\n" - " 00 .0' '0. 00 \n" - " 00 .0 0. 00 \n" - " HHHHH HHHHHHHHHHHH HHHHH \n" - "HHHH HHH HHHHHHHHHHHHHH HHHH\n" - " HHHHHH HHHHHHHHH HHHHHHHH \n" - " HHH HHHH HHHHHHHHH HHHH \n" - " HHH HHHHHH \n" - " HHHHH HH \n")) - (use-package dashboard - :ensure t - :config (setq initial-buffer-choice 'dashboard-open)) -#+end_src - ** Darkroom #+begin_src emacs-lisp (use-package darkroom @@ -643,7 +610,6 @@ For reference information, see [[https://orgmode.com][Org-mode website]] (" " . consult-buffer) (" " . consult-project-buffer) (" " . consult-org-heading) - ("C-c s s" . consult-line) ("C-c s f" . consult-fd) ("C-c s g" . consult-ripgrep) ("C-c s e" . consult-flymake) @@ -666,6 +632,22 @@ For reference information, see [[https://orgmode.com][Org-mode website]] :after (embark consult) :hook (embark-collect-mode . consult-preview-at-point-mode)) #+end_src +** Snippets +#+begin_src emacs-lisp + (use-package yasnippet + :ensure t + :hook ((prog-mode org-mode) . yas-minor-mode)) + + (use-package yasnippet-snippets + :ensure t + :after yasnippet + :config (yas-reload-all)) + + (use-package consult-yasnippet + :ensure t + :after (yasnippet consult) + :bind (("C-c s s" . consult-yasnippet))) +#+end_src ** Language-specific settings *** kmonad #+begin_src emacs-lisp