Skip to content

Commit

Permalink
Added support for the Rust programming language
Browse files Browse the repository at this point in the history
  • Loading branch information
romatthe committed Dec 14, 2019
1 parent 4e1c3af commit bf067ec
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@
(require 'init-lang-latex)
(require 'init-lang-markdown)
(require 'init-lang-nix)
(require 'init-lang-rust)
49 changes: 49 additions & 0 deletions lisp/init-lang-rust.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
;;; -*- lexical-binding: t -*-

;; Copyright (C) 2018-2019 Robin Mattheussen

;; Author: Robin Mattheussen <robin.mattheussen@gmail.com>
;; URL: https://github.com/romatthe/dotfiles

;; This file is not part of GNU Emacs.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;

;;; Commentary:
;;
;; Configuration for working with the Rust language
;;

;;; Code:

(use-package toml-mode)

(use-package rust-mode)

;; Add keybindings for interacting with Cargo
(use-package cargo
:hook (rust-mode . cargo-minor-mode))

(use-package flycheck-rust
:hook (flycheck-mode . flycheck-rust-setup))


(provide 'init-lang-rust)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-lang-rust.el ends here
2 changes: 1 addition & 1 deletion lisp/init-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
(use-package lsp-mode
:blackout t
:bind (:map lsp-mode-map ("C-c C-f" . lsp-format-buffer))
:hook ((c-mode c++-mode java-mode) . lsp)
:hook ((c-mode c++-mode java-mode rust-mode) . lsp)
:custom
(lsp-auto-guess-root t) ; Detect project root
(lsp-prefer-flymake nil) ; Use lsp-ui and flycheck
Expand Down

0 comments on commit bf067ec

Please sign in to comment.