summaryrefslogtreecommitdiffstats
path: root/jeschli/2configs/emacs.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2019-09-17 09:09:00 +0200
committerjeschli <jeschli@gmail.com>2019-09-17 09:09:00 +0200
commitcca0a7b56417bd17926d75d1e00419366384ade4 (patch)
treea902f6fc9d777f290abb97a1dd4af988b8fd1ed8 /jeschli/2configs/emacs.nix
parent703b442b3558dfedcb7d8d8d3626d97e6f2ad275 (diff)
j emacs: add configuration for rust
Diffstat (limited to 'jeschli/2configs/emacs.nix')
-rw-r--r--jeschli/2configs/emacs.nix24
1 files changed, 23 insertions, 1 deletions
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
]);