Is there a way to preserve the highlight when wrapping a selection with quotes/brackets in RStudio? - r

In many IDEs, there's a feature where you can highlight a section of code and then press a key like ", ', (, or [ (to name a few) to surround the highlighted section with the corresponding open/close characters of the given key. In Jupyter Notebooks, the highlighted portion stays highlighted after surrounding the code with the desired characters. However, in RStudio the text cursor falls to the end of the highlighted section after pressing the key to surround the code with.
I find the behavior of this feature in Jupyter much more desirable since I can press either the left or right arrow keys to immediately place the text cursor on either side of the selected code (without touching the mouse no less). But in RStudio I find myself constantly surrounding code in parentheses or quotes then spamming the left arrow key to get the text cursor to the beginning of the code I just highlighted.
Is there a way to change this setting in RStudio to match the behavior in Jupyter Notebooks? This is the only other question I've found relating to this behavior in RStudio, but unlike OP I want to alter the behavior of this setting, not turn it off completely.
I have looked in Tools > Global Options... under the Code tab (per the link above), but don't see any obvious solution there.
EDIT: I found from this question that I can use Option+J and Option+L (Mac) or Alt+J and Alt+L (Windows) to navigate the cursor to the other end of a word quickly, but I'm still curious if anyone knows of a way to match the settings in RStudio with the behavior of Jupyter Notebooks.

Related

Select a big part of a notebook file in Jupyter Lab without scrolling

I'm using Jupyter Lab.
I would like know if there is a way to select some big part of the ipynb file without scrolling (in order to run the selected cells).
I guess a good way to do it would be by using the table of content on the left, but the "problem" is that when I click on a new part, it activates the first cell of this part so I can't use SHIFT + right click.

Leaving edit mode without any changes still leaves markdown text formatted as code

First time using Jupyter Notebook, and I'm following online tutorials to try to understand how they work.
One thing I don't understand is why, after double-clicking in a markdown cell and then pressing Esc to go from Edit Mode to Command Mode, the text is still displayed as if it were code, instead of (formatted) text:
Clicking outside of the cell doesn't change this either - only by running the cell does it turn back to formatted text. But this happens even when I've not made any changes to the cell's contents, and it seems strange to require that the cell be re-run just to exit edit Mode?!
I figured the answer is, simply, that even markdown cells that haven't been edited still need to be (re-)rendered, once one has activated edit mode for them.

How do I dismiss an autocomplete suggestion in Atom?

When I'm writing Docstrings in Python3, I'm ending all of my sentences with periods and I see an autocomplete suggestion like this:
In this case it wants to replace the string "wager." with "wagerself."
If I press Enter or Tab the string replaces. I've messed around with all the logical buttons (Including adding an extra space which doesn't work), and nothing will allow me on my merry way to a newline.
This problem occurs both with and without the autocomplete-python package installed.
I do want to use auto-complete when I type a dot after an object, just not in the comments.
Is there a way to either:
Dismiss the autocomplete suggestion as they come up.
-- or --
Change the autocomplete to be aware of the context, i.e. not autocomplete dots when I'm in a string/comment.
From experimenting with different key combos, ctrl + enter will ignore the suggestion and allow you to go to the next line without altering what you've typed.
I haven't found any documentation around this, so I'm not sure if there's a similar key combo for tab or not. I couldn't find anything myself beyond alt + tabing to lose focus, which causes the suggestion to go away, then alt + tabing back to hit tab, which obviously isn't ideal.
I'm using Atom 1.44.0 on Windows and have found that shift + enter works to dismiss an autocomplete suggestion. No luck with tab on this platform though.
I use atom extensively, and have found that a quick left-right cursor move will leave the typed text in place and will NOT reactivate the suggestion list, unless more characters are typed. You can then type and move on to the next line.
I was actually searching myself for a way to exclude "then" from the autocomplete action, because I have text in other locations that has it as a commented "Then". I was hoping to find a way to exclude that word completely, but thought to share my work-around for that little bit, instead.
I am having the same problem where my text is getting replaced with cached words where if I wanted to type “manage” but if I have used “management “ before, I will get the text what I don’t want if I press enter. I went into preferences and followed the same steps mentioned in the below article and once the preferences are changed, I don’t see the word suggestions anymore. I felt so relieved.
https://elearning.wsldp.com/pcmagazine/disable-code-hints-atom-editor/

Disable the box drawn around words

My Atom editor draws a box around some words such as devtools. How do I stop this behavior? The other weird thing it does is italicize the word REVIEW whenever I type it. But just this word REVIEW. How do I turn off this auto feature?
[EDIT from me] - Close your "find" pane.

How to turn off syntax highlighting in R-studio

I am very new to R-Studio. I was used to RGui, where there was no syntax highlight and the letters were very contrasty:
In R-Studio, the letters seem to be very dim, even the "black ones" doesn't seem as black as in RGui:
I don't have a clue how to change the colors (do you?) so I decided to turn off the syntax highlight completely. But I haven't found any way to do it. I tried Tools / Global Options, Appearance and Code Editing, but haven't found anything to change colors or turn off syntax highlighting.
I don't know of a way to turn off syntax highlighting completely. But it is possible to choose a different theme. Go to Tools - Global Options - Appearance and try the various settings for Editor theme. Maybe changing the font or font size could also improve readability.
Another option is to turn off syntax highlighting in a open file. In the lower right corner of the editor window, you should see R Script (or something else, if you are not currently editing an R Script) with two little arrows next to it:
When you click it, you can choose the language to use for syntax highlighting. If you pick Text File, there should be no highlighting at all. But you will have to redo this step whenever you load a file. At least, when you keep a file open in the editor and close RStudio, the setting will be kept when you start RStudio the next time.
I'm afraid you can't turn off syntax highlighting. There is only option to show syntax highlighting in console input. But you can still change the colors :)
Tools -> Global Options -> Appearance -> Editor Theme

Resources