From 3b5156a88a74cfae30c15f68b0809d464eb96685 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 27 Oct 2019 11:23:58 +0100 Subject: [PATCH] spacemacs: add run-assoc mode fix --- system/desktop/home-manager/spacemacs.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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