I'm trying to select all of the results found by a regex find so I can modify them all (not replace them with text!), for example, making them all uppercase with Cmd + K -> Cmd + U. I'm aware that I could do them one by one via repeating Cmd + G, Cmd + K, Cmd + U, but for a large file this simply isn't practical or realistic. I'm also aware of using bash and may other scripting alternatives, I'd like to find a way to do it inside Atom, I'm happy to install an external library if needed.
Things I've tried:
Cmd + D, this just selects the next instance of that exact letter, not the next result matching the regex.
Cmd + Shift + G and alternatives (alt/right shift/ctrl), Cmd + G selects the next result matching the Regex, which is in the right direction.
Changing all of the selected text to a unique string, highlighting them all, pressing Cmd + Z and hoping it will stay selected, it doesn't.
Lots of Googling and reading though Atom discussions.
Reading Atom's documentation on the subject
Pressing Alt + Enter will select all instances matching your Find results. This works for RegEx search also.
Source: https://github.com/atom/find-and-replace/pull/290
On Atom 1.57 (nov 2021) clicking on "find all" selects all matching items, esc to exit the search box, then copy :)
Alternatively you can select all whit the menu -> find > select all.
On mac also selects all by pressing ^ + cmd + G.
Related
I often find myself using ctrl + enter to run something in r-studio. I often find that I would like to be able to wrap whatever I am putting into ctrl + enter in the str() function.
This is particularly the case when I am piping lots of dplyr verbs together. Mutating new variables and joining dataframes etc. Sometimes halfway through the set of piped commands I need to check what the name of a variable in a dataframe that i have created is called so that i can access it via the next pipe. This usually means that i have to:
highlight the text up to the last relevant pipe
hit ctrl + enter
press the up arrow
add a bracket to the end of the pasted text
Press home
navigate via the arrows to the first line of the pasted text
type: str(
This is extremely laborious and I find myself doing it often. Is there a shorter way that I am not aware of? Otherwise is there a workflow process people use to get around this?
Ideally there would be a modified ctrl + enter shortcut that would wrap whatever is highlighted in str() and output the result to the terminal.
The question is so simple I can't seem to find an answer.
Use'SHIFT-ENTER' to get to a new line in R without executing the command.
Note for mac users: On mac is Ctrl + Enter
x <- c(1,2,3.5,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20)
I did not write the “+” at the outset of the second line. If you hit the return key after the last comma on the first line, the plus sign will be produced by R as a new prompt and you can go on typing in the rest of the numbers.
If you are a mac user, try "Option + Enter", which works for me in R 4.1.2 (High Sierra).
I have entered in code to plot a graph, but when I press Enter to execute the graph, it does not plot the graph. Rather, + symbols appear every time I press Enter to execute the command and plot the code.
Now there is a long column of + symbols in my R consoles.
Why is this happening and what can I do to prevent this from happening?
The prompt has + because it signifies that the prompt is expecting more from the line of code, a sort of continuation. This may be because you forgot to close something so the prompt expects the closing side. For example, say you forgot to close a string like so:
> "
+
+
Here, I entered a double-quote into the prompt and kept on pressing Enter. There is a missing double-quote to tell the prompt I've ended the string literal, so the prompt expects another double-quote. Once you enter the double quote the prompt will stop expecting it. For example:
> "
+
+ "
[1] "\n\n"
This is standard on all command prompts, to expect more code if something isn't ended properly, like the string literal above. Check your code to make sure you've closed all opening quotes, symbols, etc, so the prompt doesn't expect it and your code executes correctly.
The ways of exiting the prompt when this happens are:
Esc on RGui and RStudio
Ctrl-C on Terminals and Command Prompts
This could happen if you used space in the middle of an object name, eg. Column names. R doesn't allow space in between " ".
In Mac OS X Ctrl+Cmd+g replaces a word in the whole file. What's the alternative to that in Linux?
I tried to check the keybindings, but no luck.
You can use Command+. to active the Key Binding Resolver to look for the actual function bound to the shortcut on your Mac and search the function on Linux Atom to figure out what the key combination is.
Alternatively, your can search all your key binding here (see screenshot below) which accept both key combination and command name.
Using ctrl + e when you are on a word will open the find and replace panel for this word.
Then use tab to go into the "replace in current buffer field", type your replacement word.
Finally, hit enter to replace the occurrences one by one, or ctrl + enter to replace all.
This question already has answers here:
TODO comments in rStudio
(4 answers)
Closed 5 years ago.
How do I use TO DOs in RStudio? By TO DOs I mean, some special flags or comments that would stand out, so I could get back to certain things I want to rework/modify etc.
I searched on Internet as well as on Rstudio, but I don't seem to be able to find such a functionality as other IDEs have (e.g. PyCharm when I code in python). I am using comments currently, but that is very imperfect in a bigger project that is heavily commented anyway.
Can you share your tips and tricks?
Ctrl + Shift + R to create a section label that stands out. Any code that sits between this and another section label can be minimized/maximized when you need to, and you can call it TO DO.
You can also use Alt + Shift + J to jump between these section labels when you want to rework or modify them.
The answer to this question might help, I suppose.
I am not sure if it is okay to copy the full text of that answer, so briefly:
Shift + Cmd + F / Shift + Ctrl + F
enter ^\s*# TODO:
^ means the start of the string we are interested in,
\s is for any whitespace character (space, tab, line break),
and the following * implies that the whitespace character is repeated zero to an infinite amount of times;
a-a-and – run the search!