All Projects → racer-rust → Emacs Racer

racer-rust / Emacs Racer

Racer support for Emacs

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Emacs Racer

Swift Mode
Emacs support for Apple's Swift programming language.
Stars: ✭ 308 (-19.16%)
Mutual labels:  emacs
Projectile
Project Interaction Library for Emacs
Stars: ✭ 3,463 (+808.92%)
Mutual labels:  emacs
Sayid
A debugger for Clojure
Stars: ✭ 367 (-3.67%)
Mutual labels:  emacs
Evil Mc
Multiple cursors implementation for evil-mode
Stars: ✭ 308 (-19.16%)
Mutual labels:  emacs
.emacs.d
🎉 Personal GNU Emacs configuration
Stars: ✭ 313 (-17.85%)
Mutual labels:  emacs
Emacs Config
My configuration for Doom Emacs
Stars: ✭ 296 (-22.31%)
Mutual labels:  emacs
Markovkeyboard
keyboard layout that changes by markov frequency
Stars: ✭ 307 (-19.42%)
Mutual labels:  emacs
Kubernetes El
Emacs porcelain for Kubernetes.
Stars: ✭ 372 (-2.36%)
Mutual labels:  emacs
Org Wiki
Wiki for Emacs org-mode built on top of Emacs org-mode.
Stars: ✭ 319 (-16.27%)
Mutual labels:  emacs
Ensime Emacs
ENhanced Scala Interaction Mode for Emacs
Stars: ✭ 361 (-5.25%)
Mutual labels:  emacs
Emacs Refactor
language-specific refactoring in Emacs
Stars: ✭ 313 (-17.85%)
Mutual labels:  emacs
Base16 Emacs
Base16 themes for Emacs
Stars: ✭ 314 (-17.59%)
Mutual labels:  emacs
Use Package
A use-package declaration for simplifying your .emacs
Stars: ✭ 3,748 (+883.73%)
Mutual labels:  emacs
Indent Guide
Show vertical lines to guide indentation
Stars: ✭ 307 (-19.42%)
Mutual labels:  emacs
Pg
This repo is the new home of Proof General
Stars: ✭ 367 (-3.67%)
Mutual labels:  emacs
.spacemacs.d
My spacemacs configuration.
Stars: ✭ 307 (-19.42%)
Mutual labels:  emacs
Helm Bibtex
Search and manage bibliographies in Emacs
Stars: ✭ 328 (-13.91%)
Mutual labels:  emacs
Nord Emacs
An arctic, north-bluish clean and elegant Emacs theme.
Stars: ✭ 379 (-0.52%)
Mutual labels:  emacs
Writegood Mode
Minor mode for Emacs to improve English writing
Stars: ✭ 369 (-3.15%)
Mutual labels:  emacs
Org Sidebar
A helpful sidebar for Org mode
Stars: ✭ 354 (-7.09%)
Mutual labels:  emacs

Racer for Emacs

MELPA MELPA Stable Coverage Status

This is the official Emacs package for Racer.

Table of Contents

Completion

racer.el supports code completion of variables, functions and modules.

racer completion screenshot

You can also press F1 to pop up a help buffer for the current completion candidate.

Note that due to a limitation of racer, racer.el cannot offer completion for macros.

Find Definitions

racer.el can jump to definition of functions and types.

racer go to definition

You can use M-. to go to the definition, and M-, to go back.

Describe Functions and Types

racer.el can show a help buffer based on the docstring of the thing at point.

racer completion screenshot

Use M-x racer-describe to open the help buffer.

Installation

  1. You will need to use a nightly version of rust. If you're using rustup, run

    $ rustup toolchain add nightly
    
  2. Install Racer and download the source code of Rust:

    $ rustup component add rust-src
    $ cargo +nightly install racer
    
  3. Allow Emacs to install packages from MELPA:

    (require 'package)
    (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
    
  4. Install the Emacs package for Racer: M-x package-install RET racer RET

  5. Configure Emacs to activate racer when rust-mode starts:

    (add-hook 'rust-mode-hook #'racer-mode)
    (add-hook 'racer-mode-hook #'eldoc-mode)
    

    For completions, install company with M-x package-install RET company RET. A sample configuration:

    
    (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)
    

    For automatic completions, customize company-idle-delay and company-minimum-prefix-length.

    Racer process may be slow to respond for instance when indexing. You can customize racer-command-timeout and racer-eldoc-timeout to avoid rendering your Emacs session unresponsive. Eldoc timeout should be on the lower side and defaults to 0.5 seconds. You can probably tweak it down on a fast machine. Timeout of nil will wait indefinitely.

Testing your setup

To test completion: Open a rust file and try typing use std::io::B and press TAB.

To test go to definition: Place your cursor over a symbol and press M-. to jump to its definition.

Press C-x 4 . to jump to its definition in another window.

Press C-x 5 . to jump to its definition in another frame.

Press M-, to jump back to the previous cursor location.

If it doesn't work, try M-x racer-debug to see what command was run and what output was returned.

Tests

racer.el includes tests. To run them, you need to install Cask, then:

$ cask install
$ cask exec ert-runner
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].