This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/lang/rust/packages.el

54 lines
1.4 KiB
EmacsLisp
Raw Normal View History

2015-05-07 13:19:56 +00:00
;;; packages.el --- Rust Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2015 Chris Hoeppner & Contributors
;;
;; Author: Chris Hoeppner <me@mkaito.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defvar rust-packages
'(
rust-mode
toml-mode
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defun rust/init-rust-mode ()
(use-package rust-mode
:defer t
:config
(progn
(when (fboundp 'sp-local-pair) ;Don't pair lifetime specifiers
(sp-local-pair 'rust-mode "'" nil :actions nil))
;; http://doc.crates.io/guide.html
(defun spacemacs/rust-cargo-build ()
(interactive)
(shell-command "cargo build"))
(defun spacemacs/rust-cargo-run ()
(interactive)
(shell-command "cargo run"))
(defun spacemacs/rust-cargo-test ()
(interactive)
(shell-command "cargo test"))
;; (spacemacs/declare-prefix-for-mode 'rust-mode "mc" "cargo")
(evil-leader/set-key-for-mode 'rust-mode
"mcb" 'spacemacs/rust-cargo-build
"mcr" 'spacemacs/rust-cargo-run
"mct" 'spacemacs/rust-cargo-test)))
2015-05-07 13:19:56 +00:00
"Initialize rust-mode"
)
(defun rust/init-toml-mode ()
(use-package toml-mode
:defer t)
"Initialize toml-mode")