Emacs: Difference between revisions

m poll patch removed https://github.com/d12frosted/homebrew-emacs-plus/pull/746
m link to search.nixos.org
 
(3 intermediate revisions by 3 users not shown)
Line 66: Line 66:
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.emacs.enable Home Manager Options Manual].
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.emacs.enable Home Manager Options Manual].


The global options are listed on [https://mynixos.com/search?q=nixpkgs%2Foption%2Fservices.emacs MyNixOS].
The global options are listed here [https://search.nixos.org/options?channel=unstable&query=services.emacs services.emacs.*].


==== Installing Packages ====
==== Installing Packages ====
Line 108: Line 108:


When using Emacs with tree-sitter support, it's recommended to install both <code>epkgs.tree-sitter-langs</code> and <code>epkgs.treesit-grammars</code>. While <code>treesit-grammars</code> handles the registration of grammars with Emacs's native tree-sitter interface, the actual grammar files will come from <code>tree-sitter-langs</code>. <code>tree-sitter-langs</code> being a MELPA package means it receives regular updates when new grammar versions are released, whereas the grammars in the tree-sitter-grammars package may lag behind in nixpkgs. The combination ensures you get both up-to-date grammars and proper integration with Emacs's built-in tree-sitter support.
When using Emacs with tree-sitter support, it's recommended to install both <code>epkgs.tree-sitter-langs</code> and <code>epkgs.treesit-grammars</code>. While <code>treesit-grammars</code> handles the registration of grammars with Emacs's native tree-sitter interface, the actual grammar files will come from <code>tree-sitter-langs</code>. <code>tree-sitter-langs</code> being a MELPA package means it receives regular updates when new grammar versions are released, whereas the grammars in the tree-sitter-grammars package may lag behind in nixpkgs. The combination ensures you get both up-to-date grammars and proper integration with Emacs's built-in tree-sitter support.
<b>Bonus Tip:</b>
<code>emacs.pkgs.pretty-sha-path</code> is quality of life improvement for nix, guix users.
Allows toggling Guix / Nix store paths by replacing SHA-sequences with ellipsis, i.e.:
<syntaxhighlight lang="bash">
/gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1  →  /gnu/store/…-foo-0.1
/nix/store/nh4n4yzb1bx7nss2rg342dz44g14m06x-bar-0.2  →  /nix/store/…-bar-0.2
</syntaxhighlight>
located at https://github.com/alezost/pretty-sha-path.el


==== Automatic Package Management ====
==== Automatic Package Management ====
Line 121: Line 134:
       # Optionally provide extra packages not in the configuration file.
       # Optionally provide extra packages not in the configuration file.
       extraEmacsPackages = epkgs: [
       extraEmacsPackages = epkgs: [
         epkgs.use-package;
         epkgs.use-package
       ];
       ];


Line 336: Line 349:
== References ==
== References ==
[[Category:Applications]]
[[Category:Applications]]
[[Category:CLI Applications]]
[[Category:NixOS Manual]]
[[Category:NixOS Manual]]
[[Category:Text Editor]]
[[Category:Text Editor]]