diff options
| author | brotzeit <brotzeitmacher@gmail.com> | 2019-11-01 14:45:53 +0100 |
|---|---|---|
| committer | brotzeit <brotzeitmacher@gmail.com> | 2019-11-01 14:48:19 +0100 |
| commit | c5ab165f43723f29c1ebbcbe16a325f9952760ea (patch) | |
| tree | 2d3632ac7c9b120ef88117c4bf861e6425a1d20c | |
| parent | 1b3db883bccb0956e5f05b7312485b2b7a5fa70f (diff) | |
| download | rust-mode-c5ab165f43723f29c1ebbcbe16a325f9952760ea.tar.gz | |
mention LSP support
| -rw-r--r-- | README.md | 52 |
1 files changed, 48 insertions, 4 deletions
@@ -5,16 +5,23 @@ <!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> **Table of Contents** -- [Installation via MELPA](#installation-via-melpa) -- [Manual Installation](#manual-installation) +- [Installation](#installation) + - [Melpa](#melpa) + - [use-package and straight](#use-package-and-straight) + - [Manual Installation](#manual-installation) - [Indentation](#indentation) - [rustfmt](#rustfmt) - [Tests](#tests) +- [LSP](#lsp) + - [eglot](#eglot) + - [lsp-mode](#lsp-mode) - [Other useful packages](#other-useful-packages) <!-- markdown-toc end --> -# Installation via MELPA +# Installation + +## Melpa `rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs enjoyable. It requires Emacs 24 or later. @@ -36,7 +43,26 @@ And put this in your config to load rust-mode automatically: `(require 'rust-mode)` -# Manual Installation +## use-package and straight + +```elisp +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "~/tmp/git/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + +(use-package rust-mode) +``` + +## Manual Installation Add this to your init.el: @@ -71,6 +97,24 @@ The file `rust-mode-tests.el` contains tests that can be run via You can use `run_rust_emacs_tests.sh` to run them in batch mode, if you set the environment variable EMACS to a program that runs emacs. +# LSP + +## eglot + +```elisp +(require 'eglot) +(add-hook 'rust-mode-hook 'eglot-ensure) +``` + +## lsp-mode + +```elisp +(require 'lsp-mode) +(add-hook 'rust-mode-hook #'lsp) +``` + +You can find more information in the [lsp-mode wiki](https://github.com/emacs-lsp/lsp-mode/wiki/Rust). + # Other useful packages * [cargo.el](https://github.com/kwrooijen/cargo.el) Emacs Minor Mode for Cargo, Rust's Package Manager |
