spacemacs: add run-assoc mode

fix
This commit is contained in:
Ingolf Wagner 2019-10-27 11:23:58 +01:00
parent 19c2b1d73b
commit 3b5156a88a
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -163,9 +163,28 @@ in
(require 'lsp-haskell) (require 'lsp-haskell)
;; (add-hook 'haskell-mode-hook #'lsp) ;; (add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-mode-hook #'direnv-update-environment) (add-hook 'haskell-mode-hook #'direnv-update-environment)
;; setup run-assoc
;; in dired mode use C-<RETURN> 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 = '' home.file.".ctags.d/terraform.ctags".text = ''
--langdef=terraform --langdef=terraform