On Tuesday, May 23, 2017 at 6:37:01 AM UTC+5:30, Saifi wrote:
> On Tuesday, May 23, 2017 at 12:49:20 AM UTC+5:30, Chakravarthy Raghunandan
> wrote:
> > I had discovered some really neat refactoring tricks while browsing through
> > the emacs configuration of a very popular contributor to emacs.
> >
> > Here is the link to my emacs configuration for Rust:
> > https://github.com/CSRaghunandan/.emacs.d/blob/master/setup-files/setup-rust.el
> >
> > Some useful features:
> > 1. Toggle the mutability of a variable at point
> > 2. Toggle the public visibility of the function at point
> > 3. Convert the vector expression at point to slice foo -> &foo[..]
> > 4. Run the test at point
> > 5. have a local playground for trying out rust snippets
> > 6. automatically format the file with Rustfmt upon saving
> > 7. Shortcuts for executing all cargo commands
> > 8. linting using rustc error + warning messages
> > 9. Autocomplete and jump to definition of variables, functions, types,
> > etc. using Racer
> >
> > Regards,
> > Raghunandan
>
>
> Very nifty and interesting. Thanks so much for sharing, 'o wizard of emacs' !
>
> setup-rust.el file contains reference to the following
>
> https://github.com/rust-lang/rust-mode
> https://github.com/flycheck/flycheck-rust
> https://github.com/kwrooijen/cargo.el
> https://github.com/racer-rust/emacs-racer
>
> Could you please share your thoughts about how the variables and functions
> are accessed when multiple emacs lisp files are referenced ?
>
> This would help folks, with exploring further.
>
>
> warm regards
> Saifi.
No need to worry about the elisp files. Just copy over the below lines to the
init file: ~/.emacs or ~/.emacs.d/init.el . (you might need to create the file
if they don't exist):
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)
(unless (package-installed-p 'use-package) ; unless it is already installed
(package-refresh-contents) ; updage packages archive
(package-install 'use-package)) ; install the latest version of use-package
(eval-when-compile (require 'use-package))
(setq use-package-always-ensure t)
And copy over the contents of setup-rust.el to your init file (either of the
two files I mentioned above) and open emacs. It should automatically download
all dependencies and your Rust setup is ready :)
--
https://meetup.com/rustox
---
You received this message because you are subscribed to the Google Groups "Rust
Bangalore Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.