Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacemacs (emacs/vim) setup #22

Open
roryk opened this issue Aug 3, 2018 · 6 comments
Open

Spacemacs (emacs/vim) setup #22

roryk opened this issue Aug 3, 2018 · 6 comments
Labels
category-computing documents related to software administration, tools usage, tips and tricks subcategory-tips and tricks documents related to tips and tricks for code

Comments

@roryk
Copy link
Collaborator

roryk commented Aug 3, 2018

https://github.com/roryk/dotfiles/blob/master/spacemacs is my current configuration. It is basically stock spacemacs, with vim/evil mode turned on.

Hilighted changes from stock:

https://github.com/roryk/dotfiles/blob/28c508eb7431d4a8b3b6bed3cf553eb83ac8bb32/spacemacs#L60 this allows you to open up a remote terminal and then open files from it as if you were opening on that remote machine, but on your local emacs session.

R/ESS specific stuff:

https://github.com/roryk/dotfiles/blob/28c508eb7431d4a8b3b6bed3cf553eb83ac8bb32/spacemacs#L368 this line makes it so ESS stops indenting single # comments.

In your .emacs.d/private/polymode directory, add this to be able to edit RMarkdown documents and have proper syntax hlighting in code blocks:

;;; packages.el --- polymode layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Walmes Zeviani & Fernando Mayer
;; URL: https://github.com/syl20bnr/spacemacs

;;; Code:

(defconst polymode-packages
  '(polymode))

(defun polymode/init-polymode ()
  (use-package polymode
    :mode (("\\.Rmd"   . Rmd-mode))
    :init
    (progn
      (defun Rmd-mode ()
        "ESS Markdown mode for Rmd files"
        (interactive)
        (require 'poly-R)
        (require 'poly-markdown)
        (R-mode)
        (poly-markdown+r-mode))
      ))
  )

;;; packages.el ends here
@roryk
Copy link
Collaborator Author

roryk commented Aug 3, 2018

@mjsteinbaugh here is my emacs set up, let me know if this doesn't work out. You can just use my .spacemacs file from dotfiles and it should work. I run the development branch of Spacemacs and it seems to work fine.

You can stay up to date by running a git pull in your .emacs.d directory; it won't touch your .spacemacs or anything in .emacs.d/private. Every couple days I do that and do an package-list-packages U x to upgrade all of the packages. This is pretty stable most of the time.

@mjsteinbaugh
Copy link

Amazing, thanks @roryk

@mistrm82 mistrm82 added category-computing documents related to software administration, tools usage, tips and tricks subcategory-tips and tricks documents related to tips and tricks for code labels Aug 16, 2018
@mistrm82
Copy link
Contributor

should we turn this into a markdown and make a pull request?

@mjsteinbaugh
Copy link

@mistrm82 +1 for a markdown. Also, I noticed that the emacs version on O2 is too old for spacemacs, so it's be cool if HMS RC could update the version installed. Otherwise conda works.

@roryk
Copy link
Collaborator Author

roryk commented Aug 16, 2018

I don't actually use Emacs on O2; I just use tramp-term which lets me ssh into O2 and then edit the file like I normally would, but uses the local editor. Helpful for if you are using VMs and the like.

@mjsteinbaugh
Copy link

Sweet I will check that out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category-computing documents related to software administration, tools usage, tips and tricks subcategory-tips and tricks documents related to tips and tricks for code
Projects
None yet
Development

No branches or pull requests

3 participants