In my collegue's version of R the different types of text become different colours when you write in the editor(for example functions are blue while text in quotation marks is green). For me, however, all the text is black which I think makes it harder to get a quick understanding of the code. There is also no automatic line break. Is it because he has the mac version while I have the PC version? Is there som way i can change this?
Thanks in advance!
Edit: changing the settings below will allow you to change the color of, say, R help text or of code but doesn't actually enable syntax highlighting. Per #Roland's comment, your best bet is a different text editor (such as Notepad++,RStudio, or Sublime) or a syntax highlighting package. Apparently the Mac version of the R editor really is just better (per this wiki)
You can change the settings in Edit>RGUI Preferences, under "Console and Pager Colours".
Related
I'm aware of the different abilities to highlight based on filetype, but what I'm looking for is something similar to how in a typical text editor you can highlight a line (not just change the color text).
Is this possible to do in the Atom editor? If so, how do you do it? Is there a plugin for this?
The reason I want to do this is for organizational purposes, and sometimes the files I am working in our custom files that are not necessarily code but documentation (usually both are together in the same file), and the documentation part is where I want to add these highlights.
The only Atom package I know of that has a somewhat similar functionality is the bookmarks package.
It is an Atom core package, so you most likely have it installed already.
It might not be exactly what you were looking for, since it only allows setting bookmarks on lines of your open files.
As soon as you close a file, the bookmarks are lost.
But while working on several opened files, it can be very useful to quickly navigate through these bookmarks.
The reason why no package like you asked for exists, probably is that it would be really hard or at least impractical to implement.
Imagine you set dozends of highlights on a file which is under version control (git, svn, etc.) and then pull in a newer version of this file where several lines were added, removed, changed, shifted ...
To still be able to show the highlights on the correct lines, the information of such highlights would need to be under the same version control. Essentially you would need to store this highlight on the line itself, which would mean everybody had the same highlights, which is probably not what you want. Because if you wanted that, you could just format your documentation with markdown or similar in the first place ;)
As my R scripts get long and messy, I would like to create headers that are easily identifiable: for instance, change the color of certain comments in script. I am not looking for something crazy like underlining or changing the fonts for chunks of comments, just changing color, i.e. highlighting comments.
From all my search, the only option is to change the Editor appearance from setting, but I would like to distinguish certain chunks of comments from other comments.
Is there a way to disable syntax highlighting in Atom.io?
I have searched a bit and ended up creating my own syntax package (https://atom.io/themes/no-syntax-highlighting-syntax), but maybe there is a better way.
NB: I just want to disable syntax highlighting (ideally keeping only comments and code in a different color), but I still want the other language-related features of Atom.io working. Like language completions, language snippets, language closure/bloc detections, auto-indent, etc.
(Some people argues against syntax highlighting, stating it might be actually harmful to developer productivity. I wanted to try that. Ie. http://www.linusakesson.net/programming/syntaxhighlighting/ and https://www.robertmelton.com/2016/03/21/syntax-highlighting-off/)
You can use Ctrl+Shift+L (or press button bottom right) to select proper language. In your case it would be Plain Text.
Second option is install package https://atom.io/packages/file-types and add in config.cson:
'file-types':
'YOURS EXTENSION': 'text.plain'
Haven't found a better solution yet.
If you are trying to do the same thing as I was - disabling syntax highlighting in Atom.io while keeping comments differentiated, language completions, language snippets, language closure/bloc detections and auto-indent - I would just recommend to install the theme I've created: https://atom.io/themes/no-syntax-highlighting-syntax
Set the file syntax to plain text. You can do this with control alt L or something like that.
I'm trying to build a basic, Markdown-style plain/rich text editor. (One where the text is styled inline, instead of having two panels side-by-side the way most Markdown editors do) (I'm also not going to support the full Markdown spec - no lists or tables, mainly just rich text formatting like bold, italics, underline, etc)
I have a project that consumes the AvalonEdit project (via the source code, not the Nuget package) - I got the editor all setup exactly how I want - then I started to write a syntax highlighting XSHD file when I realized that the highlighter only supports formatting like font colors, italics, bold, etc and not font size, underline and others...
How can I add additional font formatting? Will I have to write a whole new parser/highlighter/whatever? Is there an easy way to hook into and extend the existing highlighter?
I've already made a few small changes to one file in the source (TextEditor.xaml), and I'm willing to change more to make this work - though when I started I was hoping to touch the source as little as possible...
If someone could just point me in the right direction, I'd appreciate it - Thanks!
From the syntax highlighting documentation:
Among the text rendering extension points is the support for "visual
line transformers" that can change the display of a visual line after
it has been constructed by the "visual element generators". A useful
base class implementing IVisualLineTransformer for the purpose of
syntax highlighting is DocumentColorizingTransformer. Take a look at
that class' documentation to see how to write fully custom syntax
highlighters. This article only discusses the XML-driven built-in
highlighting engine.
Having read and/or scanned through that page a number of times, I couldn't fully grok this until I'd looked through the code a bit more, read some posts on the SharpDevelop forums, etc.
And if you're at the same stage I was (and can't quite wrap your head around that quote), the gist is that the editor does these two things (simplified, of course):
It generates lines of visible text (it only bothers with the lines
currently visible on the screen for performance reasons)
It then runs various transformers over said generated text, to style it in various ways
So the "XML-driven built-in highlighting engine" is only one way to find and style text - one that's meant to be a simple implementation of the more 'advanced' way, which is to build a custom text transformer, like a DocumentColorizingTransformer.
And here's some info on DocumentColorizingTransformer that you may find useful (besides the API documentation they point you to):
https://stackoverflow.com/a/23251990/859833
http://danielgrunwald.de/coding/AvalonEdit/rendering.php
Does anyone know of a way to prevent Sublime Text 3 converting sass variables on pressing tab?
For example, I might type $variable-name and then press tab, intending to insert the : and space, which would be the normal CSS behaviour. Within doc type sass, I get 1variable-name:; instead.
It's rather annoying to have to correct every time, and I'm sure others get irritated with the same. I have the Sass and Emmet packages installed.
Many thanks. Your help is much appreciated.
Too long for a comment...
So I did a little digging last night, and from what I can tell this behavior is hard-coded into Sublime. The command that's executed when Tab is pressed right after a variable is expand_abbreviation_by_tab. Many times, Sublime commands are implemented in .py files, and can so be edited to suit your needs. Unfortunately, I was unable to find any mention of this command anywhere, leading me to believe that it's hard-coded. I suppose a workaround would be to enter a space before hitting Tab, if your end goal is to have the colons : aligned with each other. Another option would be to use the Alignment plugin, available through Package Control. It's very configurable, and I highly recommend it.