Colour coding comments in RStudio - rstudio

I am a very visual person and would like a distinction between #a command I commented out and a ##message for myself or co-worker on the file. I had a look around if RStudio supports different kinds of comments but it doesn't seem like it. Does anyone know a way around this?
Thanks!

You can use
#'* some colorfull comment *
to comment in color.
-R version 3.6.3
-RStudio ‘1.2.5033 "Orange Blossom"

As noted, this isn't an R question but an RStudio question (I've edited as such). RStudio doesn't currently have user-modifiable themes, just the built-in ones. That is apparently an in-development feature.
In the meantime, apparently you can hack away at the .css file that defines a theme to perhaps add what you're after - https://support.rstudio.com/hc/en-us/community/posts/200644098-appearance-Editor-theme
Otherwise, you could use a different editor that allows you to specify your desired syntax highlighting.

#'[Red]
#'#Purple
#'*Green*

Related

Why does VS 2019 make hash comments use a large font in YAML files?

This is more of an annoyance, but does anyone know why VS 2019 switches the font for hash comments in YAML files? I'd imagine it happens for any file using hash comments. My guess is that it has something to do with markdown, but I don't have any extensions for markdown, unless one of my installed extensions has it as an extra feature.
Here's an example:
Here's my installed extensions:
[
In writing this, I looked in coderush's settings and found the answer. Unchecking this option stops the annoying (in my case -- it's probably useful to a lot of other people) behavior.
Since the question was already written by the time I figured it out, I'm posting this answer in case it helps someone else.

How to spellcheck R comments with RStudio on R source files?

How to conveniently spellcheck R comments with RStudio on R source files?
I am writing a package and I want it to look professional. Thanks to Oxygen, all package's documentation lives in R comments, which by default is excluded from spell checking. So even if spell checking functionality does exist in RStudio, I don't know how to use it.
The spelling package is great for this: https://github.com/ropensci/spelling.
devtools::install_github("ropensci/spelling")
spelling::spell_check_package() # path to package Project
RStudio 1.3 will include this feature; and it is possible to already try it out.
Well this is moot now that Rstudio has spellcheck for spin documents!
So, I write a lot of my lessons and examples for teaching using spin rather than markdown. It just makes for an easier flow. The problem is that there is no spell-check in a spin document, much like your package documentation example.
What I have resorted to is using the terminal then running a command line spellchecker on the document.
I'm on linux so here is my workflow.
save the file I am working let's say example_lesson.R (typos and all)
open the terminal pane of Rstudio and cd to the right folder
make sure the file example_lesson.R is there
run the spell-checker
> aspell check example_lesson.R
Once I'm done with aspell, I go back to the editor window in Rstudio and it updates what I am working on with the spell-checked version. I spin it and I am done.
I've only tested with small examples, but it has worked thus far. Your mileage may vary. Hope that helps.

Sublime Text 3 Doesn't Recognize %i in ruby

I'm using the latest build of Sublime Text 3. When typing %i[foo bar] Sublime does not seem to recognize this and I don't get the proper highlighting.
Has anyone else experienced this? If so, is there a way I can fix this on my end or is this something that Sublime HQ would have to fix?
The %i[foo bar] # [:foo :bar] literal notation for a symbol array was only implemented in Ruby 2.0, while the Ruby language definition that ships with ST3 is mostly focused on 1.9 and earlier. I searched around a bit, but unfortunately I couldn't find any .tmLanguage files that are updated for 2.0, let alone include this literal notation, so I can't point you to a ready-made solution. But, I do have a few suggestions.
First, head over to the unofficial Sublime Text Issues tracker and post a bug report. We're not sure how much attention is paid to this list by the developer, but it at least broadens the issue's visibility and may prompt someone to post a fix. You can also reply to this thread on the Sublime Text forum and perhaps reference your issue.
The second option, if you have good regex-fu, is to hack the Ruby.tmLanguage file and add support yourself. I was going to post directions on how to do it, but then I tried it myself and it seemed to work, so feel free to use my work:
Go to Preferences -> Browse Packages to open up the Packages folder in your system's file explorer.
Create a folder called Ruby2.
Copy the contents of this gist into a new file, and save it in your Ruby2 directory as Ruby2.tmLanguage.
Restart Sublime, switch to your problematic code, and select View -> Syntax -> Ruby2. Both lines should now be highlighted the same way. Here's a before and after screenshot using the Neon Color Scheme:
I hope this helps. I'm not a Rubyist, so if I made any blatant errors please let me know.
From my (brief) research there definitely seems to be a need for an updated version of Ruby.tmLanguage for all the new features in 2.0, so hopefully any issues you post will prompt someone to start/publish a project. I've already done something similar for Python, but my Ruby skillz just aren't there for this project :)
Good luck!

color code editor for sass scss windows

I am looking for the simple color code software to edit scss file for windows.
I am sorry if the question is repeated but i am tired of searching and found mostly broken files.
Please Suggest
I'm making the assumption that you are asking for a windows text-editor that supports SCSS syntax highlighting, and not a color-picking utility.
If so, I would recommend
notepad++ with user defined SCSS hightlighting [EDIT - old link broke, swapping out for new one] that you can download here or another here
or, if you are willing to pay $60, Sublime Text 2 is the best windows/mac/linux text editor (IMHO). There is a SCSS Plugin that should have everything you need.
If that is not what you are looking for, please clarify your question so we can help you better.

Customize VisualStudio syntax highlighting even more

I am wondering if it is possible to set VisualStudio IDE so it highlights private/protected/public variables of the class differently as well as change formatting on locals (i.e. variables that are either passed in or declared inside a function, like this).
I did not find any such options in the normal Fonts and Colors menu of VS. Also a search on SO reveals that (at least as of 2 years ago) only add-ons provide such features. But is there a way to manually edit some file? Just because we don't get a nice UI to edit, doesn't mean underlying framework automatically doesn't support it. I mean add-ons have to plug into something to do their magic in the editor. Any insights into this issue?
Thanks!
EDIT: I have found the following information on MSDN Syntax Highlighting (Managed Package Framework). But the explanation/examples given are woefully inadequate. Does anyone know of a more extensive docs/tutorials/etc. for MPF?
I could be wrong (probably am) but I think plugins that do what you want replace the default highlighter in Visual Studio, so I don't think there is a file you can edit. As far as I know, you need a plugin. ReSharper might do this...I'm not sure though (I don't use it)

Resources