From c5ab165f43723f29c1ebbcbe16a325f9952760ea Mon Sep 17 00:00:00 2001 From: brotzeit Date: Fri, 1 Nov 2019 14:45:53 +0100 Subject: mention LSP support --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3672a28..a732ae7 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,23 @@ **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) -# 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 -- cgit v1.2.3 From 9107989da42561ab3fceb4a816077486c7d9f706 Mon Sep 17 00:00:00 2001 From: brotzeit Date: Fri, 1 Nov 2019 19:43:42 +0100 Subject: review --- README.md | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a732ae7..d78ac28 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - [Installation](#installation) - [Melpa](#melpa) - - [use-package and straight](#use-package-and-straight) + - [straight](#straight) - [Manual Installation](#manual-installation) - [Indentation](#indentation) - [rustfmt](#rustfmt) @@ -43,24 +43,9 @@ And put this in your config to load rust-mode automatically: `(require 'rust-mode)` -## use-package and straight +## 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) -``` +[straight.el](https://github.com/raxod502/straight.el#install-packages) clones each of your packages directly from its source. There are good additional [installation instructions](https://github.crookster.org/switching-to-straight.el-from-emacs-26-builtin-package.el/) for moving your package management from package.el to straight. ## Manual Installation @@ -101,17 +86,12 @@ you set the environment variable EMACS to a program that runs emacs. ## eglot -```elisp -(require 'eglot) -(add-hook 'rust-mode-hook 'eglot-ensure) -``` +[Installation instructions](https://github.com/joaotavora/eglot#connecting-automatically) ## lsp-mode -```elisp -(require 'lsp-mode) -(add-hook 'rust-mode-hook #'lsp) -``` +[Installation instructions](https://github.com/emacs-lsp/lsp-mode#installation) + You can find more information in the [lsp-mode wiki](https://github.com/emacs-lsp/lsp-mode/wiki/Rust). -- cgit v1.2.3