diff --git a/system/desktop/home-manager/spacemacs.nix b/system/desktop/home-manager/spacemacs.nix index a2ad8b1..8c49bb3 100644 --- a/system/desktop/home-manager/spacemacs.nix +++ b/system/desktop/home-manager/spacemacs.nix @@ -163,9 +163,28 @@ in (require 'lsp-haskell) ;; (add-hook 'haskell-mode-hook #'lsp) (add-hook 'haskell-mode-hook #'direnv-update-environment) + + ;; setup run-assoc + ;; in dired mode use C- to open file in associated program + (load "~/.spacemacs.d/run-assoc.el") + (setq associated-program-alist + '( + ("${pkgs.evince}/bin/evince" "\\.pdf$") + ("${pkgs.libreoffice}/bin/libreoffice" "\\.odt$") + ${ + let + suffixes = ["jpg" "jpeg" "png"]; + rule = suffix: ''("${pkgs.feh}/bin/feh --auto-rotate --auto-zoom" "\\.${suffix}$")''; + in + lib.concatStringsSep "\n " (builtins.map rule suffixes)} + ) + ) ''; - + home.file.".spacemacs.d/run-assoc.el".source = pkgs.fetchurl { + url = "https://www.emacswiki.org/emacs/download/run-assoc.el"; + sha256 = "1rg0pa09zfslgqnhbqvaa6vdi2fmanrpyzq67ppiin0h1kdgs4im"; + }; home.file.".ctags.d/terraform.ctags".text = '' --langdef=terraform