Add rust-mode support
This commit is contained in:
parent
ae7090a509
commit
73a01409c2
4 changed files with 51 additions and 3 deletions
12
Cask
12
Cask
|
@ -146,15 +146,21 @@
|
||||||
(depends-on "cmake-mode")
|
(depends-on "cmake-mode")
|
||||||
(depends-on "glsl-mode")
|
(depends-on "glsl-mode")
|
||||||
;; Org
|
;; Org
|
||||||
;;(depends-on "org-plus-contrib")
|
;; (depends-on "org-plus-contrib")
|
||||||
;;(depends-on "org-opml" :git "https://github.com/edavis/org-opml")
|
;; (depends-on "org-opml" :git "https://github.com/edavis/org-opml")
|
||||||
|
;; (depends-on "org-bullets")
|
||||||
|
;; (depends-on "org-tree-slide")
|
||||||
|
;; Rust
|
||||||
|
(depends-on "rust-mode")
|
||||||
|
(depends-on "company-racer")
|
||||||
|
(depends-on "racer")
|
||||||
|
(depends-on "flycheck-rust")
|
||||||
;; Other
|
;; Other
|
||||||
(depends-on "swift-mode")
|
(depends-on "swift-mode")
|
||||||
(depends-on "vimrc-mode")
|
(depends-on "vimrc-mode")
|
||||||
(depends-on "crystal-mode" :git "https://github.com/jpellerin/emacs-crystal-mode/")
|
(depends-on "crystal-mode" :git "https://github.com/jpellerin/emacs-crystal-mode/")
|
||||||
|
|
||||||
;; (depends-on "haxe-mode")
|
;; (depends-on "haxe-mode")
|
||||||
(depends-on "rust-mode")
|
|
||||||
;; (depends-on "d-mode")
|
;; (depends-on "d-mode")
|
||||||
|
|
||||||
;; (depends-on "shaderlab-mode" :git "https://bitbucket.org/bbbscarter/emacs-shaderlab-mode")
|
;; (depends-on "shaderlab-mode" :git "https://bitbucket.org/bbbscarter/emacs-shaderlab-mode")
|
||||||
|
|
32
modules/module-rust.el
Normal file
32
modules/module-rust.el
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
;;; module-rust.el
|
||||||
|
|
||||||
|
;; NOTE Install instructions
|
||||||
|
;; brew install rust
|
||||||
|
;; git clone https://github.com/phildawes/racer.git ~
|
||||||
|
;; cd ~/racer
|
||||||
|
;; cargo build --release
|
||||||
|
;; mv ~/racer/release/racer /usr/local/bin
|
||||||
|
;; rm -rf ~/racer
|
||||||
|
|
||||||
|
(use-package rust-mode
|
||||||
|
:mode "\\.rs$"
|
||||||
|
:config
|
||||||
|
(build-for! rust-mode "cargo run" "Cargo.toml")
|
||||||
|
(use-package flycheck-rust
|
||||||
|
:config (add-hook! rust-mode 'flycheck-mode))
|
||||||
|
|
||||||
|
(use-package racer
|
||||||
|
:config
|
||||||
|
(bind! :m "gd" 'racer-find-definition)
|
||||||
|
(setq racer-cmd "/usr/local/bin/racer"
|
||||||
|
racer-rust-src-path "~/Dropbox/lib/rust/src/")
|
||||||
|
|
||||||
|
(add-company-backend! rust-mode (racer))
|
||||||
|
|
||||||
|
(add-hook! rust-mode
|
||||||
|
(racer-activate)
|
||||||
|
(racer-turn-on-eldoc)
|
||||||
|
(add-hook! flycheck-mode 'flycheck-rust-setup))))
|
||||||
|
|
||||||
|
(provide 'module-rust)
|
||||||
|
;;; module-rust.el ends here
|
5
private/templates/rust-mode/@@Cargo.toml
Normal file
5
private/templates/rust-mode/@@Cargo.toml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[package]
|
||||||
|
name = "${1:Project Name}"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = [ "`user-full-name` <`user-mail-address`>" ]
|
||||||
|
$0
|
5
private/templates/rust-mode/@@main.rs
Normal file
5
private/templates/rust-mode/@@main.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
${0:println!("Hello, world!");}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue