Is there R code for moving the focus to the RStudio console? - rstudio

I am constantly typing into the edit window of RStudio after my code completes execution, when my intention is to provide some input in the console window. Is there R code that could be executed that would automatically move the focus to the console window of RStudio?

In RStudio, go to the menu: Tools > Global Settings. In Global Settings, choose "Code" on the left and check the box that says "Focus console after executing from source."
If you don't want to change this global option, these keyboard shortcuts can make switching between the console and editor in RStudio much faster:
Ctrl+1 moves focus to the source editor
Ctrl+2 moves focus to the console
In addition, Alt+Shift+k brings up a list of most keyboard shortcuts

If you not look for a shortcut but for code, RStudio has the following command
rstudioapi::executeCommand('activateConsole')
See also RStudio IDE Commands

Related

How to configure Visual studio code to use standard tab switching shortcut for mac?

Most OS X applications with tabbed interface allow using Cmd+Shift+[ and Cmd+Shift+] to switch tabs.
VSCode does not follow this. Is there a way to configure it to use these shortcuts to quickly switch to the next (towards right) and previous (towards left) tab.
This behavior is different from Ctrl+Tab behavior which shows a menu of most recent buffers. Repeatedly pressing Ctrl+Tab will keep alternating between same two recent buffers. But I would expect both Cmd+Shift+[ or Cmd+Shift+] to cycle through all the tabs, in right to left and left to right direction respectively.
You can bind every shortcut yourself if you want. Open you keybindings.json (via command palette or menu Code->Preferences->Keyboard Shortcuts).
Pressing cmd+k cmd+k gives you a little input field that prefills the correct JSON syntax.
The commands for switching tabs are called workbench.action.nextEditor and workbench.action.previousEditor

How to increase RStudio editor size?

In Eclipse, I am able to do Ctrl+M while I am typing in the editor to full-screen the editor and temporarily hide all the side-windows. Is there a way to achieve this in RStudio? The code editor portion of the window is very small and yet I don't feel like manually fiddling with the mouse to resize my console/plots/workspace windows.
The view menu doesn't offer much else than zooming in/out.
All shortcuts Alt+Shift+K
You can make the editor fill up the entire rstudio window with Ctrl+Shift+1. Also to restore.
To move between the panes, the shortcut is CTRL + number.
1 - source
2 - console
Adding shift to the shortcut makes that pane fill up the spaces.
The best solution I've found is to use a "source window", i.e. pop out the editor into a separate window temporarily:
This window can then be expanded to fill the whole screen:
Only way I know how is to click on the right hand side of the title bar of the source code section where it has 2 windows symbols. The right-most one expands the code window to the entire left hand side.
Instructions and documentation below from the R studio manual:
http://www.rstudio.com/ide/docs/using/console
If you're running on Linux, you can install RStudio Server, just for use on the same computer. It's almost exactly like the regular RStudio, but inside a browser. I prefer it because I can full screen, and can use the browser's Find in the console.

How do I paste long arguments into the debugger in Windows?

I'm trying to write my function's arguments in a text editor and paste them into the console, but the console won't let me.
(My list of arguments is long and the formatting starts to go crazy.)
I'm using ghci running in a cmd.exe window.
What can I do?
As pointed out in the comments, in a windows console you can right-click the title bar and do Edit > Paste.
If you'd rather just right-click in the window to paste immediately, you can turn on QuickEdit Mode:
Right-click the title bar of the window, and choose Properties.
Select the Options tab
In Edit Options, tick QuickEdit Mode
Click OK, and when it asks you, choose
Save properties for future windows with the same title. This means it'll happen every time you run ghci.
Works under XP, and as far as I can tell via Google, the same trick works in Vista and Windows 7.
This also has the effect that you don't need to choose Edit > Mark to select text. (Press enter after selecting to copy, and of course, right-click to paste.)

Get the autocompletion popup to appear when typing in the text editor

Like Visual Studio, I want the code completion menu to popup immediately after I start typing.
I don't mean the completion inline - I mean I want the same window that popups when you press esc to appear.
Is there anyway of doing this?
The code completion settings are in Xcode Preferences (shortcut: command-comma) -> Code Sense. I don't think you can make the actual pop-up list (as oppose to the completion line) appear without hitting escape.

Setting position for prompt in Visual Studio?

How can I set the position for the output prompt in Visual Studio 2008 when debugging is started?
I have two screens and I want the prompt to always appear on my second screen so that I still can see the code on the primary screen, I have tried some tricks but I haven't got it right.
I'm not sure what you mean by "outputprompt". If you are creating a command line application and are talking about the command window, then
position the window where you want it (you can pause you app if it closes too fast)
click on its system menu, then click on properties
on the third tab of the appearing properties dialog, enter the values you like (be sure to uncheck automatic window positioning)
close the dialog by clicking OK
in the dialog that appears, pick the option that changes the link, instead of just changing the current window (I'm not sure either a German or English translation of the options is helpful for you)
HTH.

Resources