zoukankan      html  css  js  c++  java
  • rust Linux环境下开发环境安装 和 IDE工具 EMACS配置

    官网:https://rustlang-cn.org/

    安装教程:https://rustlang-cn.org/office/rust/book/getting-started/ch01-01-installation.html

    emacs rust:https://manenko.com/2016/08/03/setup-emacs-for-rust-development.html

    emacs 支持rust的配置

    注:

    1、export PATH="$HOME/.cargo/bin:$PATH"加到文件.bashrc,

    (exec-path-from-shell-initialize)加到emacs配置文件以解决:auto-save-buffer cant locate executable rustfmt;

    2、(setq racer-rust-src-path "/home/wang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")不能自动补全添加;

    3、安装racer到此网站:https://github.com/racer-rust/emacs-racer;

    4、如果找不到racer添加:(setq racer-cmd "~/.cargo/bin/racer");

    ;; rust part

    ;;(require 'package)

    ;;(add-to-list 'package-archives

    ;; '("melpa" . "https://melpa.org/packages/") t)

    (package-initialize)

    (package-refresh-contents)

    (add-hook 'racer-mode-hook #'company-mode)

    (require 'rust-mode)

    (add-hook 'rust-mode-hook

    (lambda () (setq indent-tabs-mode nil)))

    (setq rust-format-on-save t)

    (define-key rust-mode-map (kbd "C-c C-c") 'rust-run)

    (add-hook 'rust-mode-hook 'cargo-minor-mode)

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

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

    (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)

    (setq company-tooltip-align-annotations t)

    (exec-path-from-shell-initialize)

    (setq racer-rust-src-path "/home/wang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")

  • 相关阅读:
    一些想说的事
    化学离子平衡作业偷懒神器
    solution
    SGU 刷题记
    INT128
    # 字典树的指针写法 1.
    CSP-S2 游记
    Tarjan 【整理】
    HGOI 20191106
    20191101
  • 原文地址:https://www.cnblogs.com/wangwangever/p/12558915.html
Copyright © 2011-2022 走看看