From cca0a7b56417bd17926d75d1e00419366384ade4 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 17 Sep 2019 09:09:00 +0200 Subject: j emacs: add configuration for rust --- jeschli/2configs/emacs.nix | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jeschli/2configs/emacs.nix b/jeschli/2configs/emacs.nix index 819a2bc61..561c13303 100644 --- a/jeschli/2configs/emacs.nix +++ b/jeschli/2configs/emacs.nix @@ -101,6 +101,23 @@ let (global-set-key "\C-ctm" 'mh/load-monokai-theme) ''; + # Configuration for rust development + # inspired by + # https://github.com/bbatsov/prelude/blob/master/modules/prelude-rust.el + rustDevelopment = '' + (add-hook 'rust-mode-hook #'racer-mode) + (add-hook 'rust-mode-hook (lambda() + (local-set-key (kbd "C-c C-d") 'racer-describe) + (local-set-key (kbd "C-c .") 'racer-find-definition) + (local-set-key (kbd "C-c ,") 'pop-tag-mark)) + ) + (add-hook 'racer-mode-hook #'eldoc-mode) + (add-hook 'racer-mode-hook #'company-mode) + (require 'rust-mode) + (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common) + (setq company-tooltip-align-annotations t) + ''; + recentFiles = '' (recentf-mode 1) (setq recentf-max-menu-items 25) @@ -116,6 +133,7 @@ let ${magit} ${orgMode} ${recentFiles} + ${rustDevelopment} ${theme} ${windowCosmetics} @@ -132,14 +150,18 @@ let epkgs.melpaPackages.google-this epkgs.melpaPackages.haskell-mode epkgs.melpaPackages.monokai-alt-theme +# rust epkgs.melpaPackages.rust-mode + epkgs.melpaPackages.flycheck-rust + epkgs.melpaPackages.racer + epkgs.melpaPackages.elpy + epkgs.elpaPackages.bbdb epkgs.orgPackages.org-plus-contrib epkgs.melpaPackages.smex epkgs.melpaPackages.org-mime - epkgs.elpaPackages.bbdb epkgs.elpaPackages.which-key ]); -- cgit v1.2.3