After years of using this site, I'm finally posting my first question!
In RStudio, I often develop a line of code in the console, and then once satisfied, I copy and paste it into my source code. Since I do this many times a day, I thought it would be great if there were a keyboard shortcut.
I don't see anything for this listed in RStudio's keyboard shortcuts (click on Tools -> Keyboard Shortcuts Help). The only way I've figured out to do this via the keyboard is the following:
Type command at console (don't hit Enter)
Ctrl + U (copy line up to cursor)
Ctrl + 1 (switch to source)
Ctrl + Y (paste line)
Ctrl + 2 (switch back to console)
Question: As you can see, this is not much of a shortcut. Any other hacks? Or better yet, is there a way to define RStudio keyboard shortcuts in addition to the ones that are already defined?
Environment:
RStudio version 1.0.44
R version 3.3.2
Mac OSX 10.11.6
Related
By default, IntelliJ has Ctrl + C and Ctrl + V set as copy/paste shortcuts. This also applies to the terminal, though.
This is odd since (on Ubuntu at least) almost every other terminal uses Ctrl + Shift + C and Ctrl + Shift + V for copy/paste shortcuts (and Ctrl + C sends SIGINT).
Changing the copy/paste shortcut in IntelliJ's settings changes the shortcut everywhere, but I don't want it to apply to the editor (just the terminal). This behavior is even mentioned in IntelliJ's terminal help page; https://www.jetbrains.com/help/idea/terminal-emulator.html
The embedded terminal emulator also inherits the following IDE settings:
On the Keymap page, you can configure the copy Ctrl + C and paste Ctrl + V shortcuts.
Is there some hidden setting I'm not seeing somewhere to change the copy/paste behavior of just the terminal in IntelliJ?
It's a known issue with no workarounds available at the moment:
IDEA-230084 In Idea's terminal on Linux, shortcuts Ctrl-C and Ctrl-Shift-C are swapped
When working with the built in terminal in IntelliJ IDEA 2016.2.3 on OSX El Capitan the process exiting command (control-c) doesn't work. It only writes c in the console and nothing happens.
Control+C and then ENTER works in 2018.3 (in Windows).
According to your settings it should be Meta + C. Normally it is the same key combination used to 'copy' purpose.
Anyway you can check and use as follows,
Go to Settings -> Keymap
On the top-right corner type 'copy' and press Enter.
The first key pair (here Meta + C ) should be the one you needed.
You can also change the keymap you are using from the 'keymap' drop down menu appearing here, and switch to a different one, if you are not comfortable with your settings. 'Mac OS X 10.5 + would be a good one for you.
Problem solved automatically with installing a newer version of IntelliJ IDEA.
You can close the terminal session by clicking the red X on the left of the the terminal tool window, and this should also kill any processes created by the terminal. If you want to run another command, just open the terminal back up.
Keymapping works if one got a few dime of time in their hands. For me, just pressing "q" and hitting enter comes out of existing command in the terminal.
Note: you wont see anything that you may type, so just go with the flow!!!
For me is ctrl+F2 to terminate the process.
For me it was ctrl shift w. But it closes terminal window.
Just right click to see context menu, you'll see.
Google's bigquery editor has keyboard shortcuts. For example ctrl+space composes a new query. I suspect there are more shortcuts, but I haven't found an useful list of them. Does anyone know them?
Ctrl + Space: If no query is open: compose new query. If query editor is open: autocomplete current word.
Ctrl + Enter: Run current query.
Tab: Autocomplete current word.
Ctrl: Highlight table names.
Ctrl + click on table name: Open table schema.
Ctrl + E: Run query from selection.
Ctrl + /: Comment current or selected line(s).
Ctrl + Shift + F: Format query.
(on Mac, replace Ctrl with Cmd)
This is the list from the official documentation: https://cloud.google.com/bigquery/docs/bigquery-web-ui#keyboard_shortcuts
You can see the shortcuts on the UI.
I found myself constantly refreshing bq page by accidentally hitting F5 as it is commonly used shortcut in many data tools for query/script execution. So in recently published Chrome Extension - BigQuery Mate - I have added F5 to execute query while in query editor.
Just Added:
I realized (a little ago) that one more shortcut is available now that i didn't know or see anyone mentioned before and was not available at a time this question was asked:
While your mouse is over Query Editor - pressing Alt - enters you into mode of copy of any rectangular part of your code. Quite useful!
July, 7 2016 Refresh:
I thought it also can be helpful to refresh this post with some BgQuery Mate keyboard shortcuts:
F5 – run query
Ctrl + F5 – run selection
F1 – help on selected or under-cursor-position keyword/function - opens respective documentation (SQL Version sensitive - Legacy / Standard)
Ctrl + Alt + / and Shift + Ctrl + Alt + / - comment/uncomment outside selection
Contextual Menu
Right Click > BigQuery Mate > Help on selected keyword/function – opens respective documentation (SQL Version sensitive - Legacy / Standard)
Right Click > BigQuery Mate > Preserve Format anywhere in Editor – Preserve Format – adjust Query Text such that further copy/paste preserves casing
I don't know all of them, but this seems a good place to share those I know:
ctrl+enter: runs the query
tab: autocomple
keep ctrl pressed: highlights the tables, clicking on them takes you to it
(note that in Apple ctrl might be the command key - I didn't know about ctrl+space, but it might be overloaded by mac os)
Continuing from Felipe Hoffa's answer above, the following keyboard shortcuts work on the Mac:
ctrl+enter: runs the query (same as Windows)
tab: autocompletes
keep the command key pressed: highlights the tables, clicking on them takes you to it.
Apparently, in the new tabbed view UI, there's two new keyboard shortcuts:
Alt+↑: move line of code up
Alt+↓: move line of code down
There might be others. I found them by accidentally hitting these keys. I can't find any documentation on these shortcuts, or I would include it.
friends.
I have installed Intellij-Idea 14 on my Linux Mint 17 distribution. All is great but I can't select text with Shift + arrays. The behavior of the Shift button is the same with the Ctrl button. Also the cursor is changed frequently from carret to "Insert type". Sometimes the cursor selects the text just with arrays without Shift-keypress.
I tried to change the keymap from Settings->Appearance and Behavior, but no one of them not resolved my problem. This problem is present not only in code editor. It is present in tool windows, consoles etc. In other applications from my OS there are no problem.
The problem was in "VIM emulator". It was activated by "Ctrl + Alt + V" keypress. I deactivated it from Tools -> Vim Emulator
Ctrl+D performs the find_under_expand command in sublime. This basically searched for the next occurrence of the already selected text and selected it, so when I edit, it's edited on both places at the same time. I'm currently trying to move to IDEA editors (such as WebStorm, PHPStorm, PyCharm, etc) but didn't find something like this command in this IDE yet.
I believe they recently added this to the latest IntelliJ release, and I would assume PhpStorm as well. As the bindings are system specific, take a look at http://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/. Looks like that version is available through EAP, so don't know when they will release it for general consumption (or if they have already).
DEFAULT SHORTCUTS
Alt+J on Windows and Linux, Ctrl+G on Mac OS X
On Mac OS X, you can select the next occurrence with Ctrl+G
In the settings window, search for ”Add Selection for Next Occurence” (PhpStorm 8.0.1)
On mac the default is ctrl+G, but you can change it to ctrl+D (or cmd+D on mac)
Currently its mapped with
for selection, Alt + J
for unselection, Alt + Shift + J
but if you're familiar with sublime shortcuts like Ctrl + D
Jetbrains give you an option to change settings,
Settings -> Keymap -> Editor Actions
search for multiple selection, find Alt + J
then right click -> select change keyboard shortcuts
set shortcuts you want as like sublime, Ctrl + D
Here is the Docs
On Windows
Alt+j - Multiple Select
Alt+Shift+j - Unselect Multiple Select
I think what you want to do is refactor it at all the place in the file at once.
So in MAC machine the handy shortcut for it is shift + F6 (you may have have to use fn key before F6).
Click on the text you want to change and then press shift + F6. It will highlight the text and then your change at all the place in the file. :)
It will do the job same as sublime ctrl + D
PhpStorm has a "Select Word at Caret", Ctl+W and Ctl+Shift+W respectively (you can check your keys by searching under Preferences > Keymap).
Detail here:
http://www.jetbrains.com/phpstorm/webhelp/selecting-text-in-the-editor.html#d617165e275
Not entirely sure if it's the same as you mentioned, but it's mighty handy!