keyboard shortcut for assignment pipe (%<>%) in RStudio? - rstudio

Does the assignment pipe %<>% from magrittr package have a keyboard shortcut in RStudio?
If not, how can I add it?

Install the extrainserts package, which creates several Rstudio AddIns.
One of them inserts the %<>% operator and automatically surrounds it by single spaces.
Then you can search for Insert %<>% within the RStudio Keyboard Shortcuts Menu (access via e.g. Tools -> Modify Keyboard Shortcuts) and assign it to your preferred keybinding.

Related

Visual Studio Code shortcut to display autocomplete list before typing on macOS

I am trying to display all possible words after putting the cursor in certain place in the code.
The autocomplete list appears when I start writing/typing:
However, I would like to see all suggested words even before typing.
I tried command + space, however it was a system shortcut for Search in macOS:
Any thoughts?
In case you are a CJK user using Mac, Ctrl+Space will not work, since it is used to switch IMEs.
There is another keyboard shortcut for triggering suggestions:
Option+Esc (Mac)
Alt+Esc (Windows)
Also see this post.
VS code version: 1.41.1
I solved this problem using fn+control+space.
Hope it helps you.
"change input source" keyboard shortcut should be disabled
To disable it->
Go to system preferences -> keyboard -> input sources
add a new input source (choose ABC)
Go to shortcuts tab (inside of keyboard settings)
Click on input sources on the left
disable the "select previous input source" shortcut
restart your vs code and now ctrl+space will show quick suggestions.
You can use the following alternative keyboard shortcuts:
⌘+I (mentioned in the official VS Code documentation for "Trigger suggestion")
⌥+esc
fn+control+space
The shortcut for the "Trigger Suggest" command is ⌃Space (ctrl+space) — as mentioned in the comments.
Most default shortcuts can be found in the documentation, which will automatically show the correct keybindings for the system you're on. In other words, if you visit the page on a Mac, you'll see Mac keybindings.
Additionally, you can:
go to Code > Preferences > Keyboard Shortcuts (on a Mac) and search for keybindings based on the command you want to execute
open up "show all commands" (⇧⌘P on a Mac) and search for the command there, allowing you to either view the keybinding for that command, or simply navigate to it directly from the search
Of course you'd have to have some idea of what the command's name might be. And in this case, a search for "suggest" would suffice.
If you use too many keyboard layouts, maybe the MacOS shortcut might be active. You can disabled ^(Ctrl)+Space shortcuts for MacOS.
System Preferences>Keyboard>Shorcuts>Input Sources> Disable Select the previous input source.
You can use next shortcut for change input sources.Ctrl+Alt+Space
when I was set up 2 keyboards with different layouts, and it turn out it overrides the ^+Space behavior, so this is how fix it:
Go to system preferences -> Keyboard -> Keyboard shortcuts
Click on input sources
and disable the "select previous input source" shortcut

Mac: Disable Keyboard-Shortcut for symbol

On my mac, typing Option-Shift-R in any text field in any program inserts a "‰" character. The problem is that I use Option-Shift-R as a special shortcut in another program (PyCharm), and whenever I use this key it both executes the action in pycharm and types the character, which is annoying.
Given that I've never once needed the "per-mille" symbol in my life, is there a way on mac to disable this shortcut? There seems to be no option for it in the "Keyboard -> Shortcuts" menu.
It is your keyboard layout that's producing "‰" when you press Option-Shift-R. (It's also what produces "A" when you press the A key, and everything else.)
You can try switching to a different built-in keyboard layout using System Preferences > Keyboard > Input Sources, but you probably won't find one which produces nothing when you press Option-Shift-R.
So, your best bet is probably to create a custom keyboard layout and use that. There's an app called Ukelele that can help create such custom keyboard layouts. I haven't check recently, but I'm fairly sure it can create a new one by copying one of the built-in layouts, which you then tweak just a bit so most things work just as you expect.

Is it possible to implement a "Vim" toggle in Visual Studio?

Ie, specify [ctrl][alt]+v or something...and that would instance vim inside that text editor window... because that would be really cool.
And/Or: is there a way to do it yourself, if you wanted to? Ie, can you attach custom functions to the keyboard keys and whatnot? I noticed that a lot of the Add-Ins seem to be able to kindof accomplish that level of customizability...
There are a few projects that incorporate vim keybindings directly into the Visual Studio editor.
Here's one: VsVim
I'm using VsVim
You download the plugin from the link above, double click on it and it will be installed in all VisualStudios you have installed in your computer.
About toggling VIM in VisualStudio:
I don't think you can enable/disable it per tab or file openned: either is enabled or disabled in all files.
What you could do is this: add a new shortcut to enable or disable it when you need it.
Tools -> Options... -> Environment -> Keyboard
On the "Show commands containing" input type "VsVim.ToggleEnabled". For me this command wasn't bind it with anything. I added the shortcut
Ctrl Q, Ctrl V

visual studio shell F# keyboard shortcuts

I've started using F# with the visual studio shell and I like the capability to be able to send lines to fsi by highlighting them, but the alt+Enter shortcut is really awkward and I would be much happier with this being on shift+Enter. (mainly since shift+ up/down arrow is select lines already)
Does anyone know how to change this? Thanks.
You can alter the keyboard mappings within Visual Studio. If you go to Tools -> Options -> Environment -> Keyboard, you'll see a window like the image below.
In order to check existing bindings, place the cursor in the "Press shortcut keys:" box and hit "Shft+Enter". You'll then see any potential conflicts in the drop-down box as shown.
In the example below, I'm searching through Global, which means shortcuts for anything in the application. You can switch it to be just the console or whatever you like.
Once you're happy with the shortcut you want to use, you need to select the command from the window containing all of the Action.* lines and then press Assign.
So I don't mean to be trite, but have you tried mapping the key?
So for F# Interactive I see Alt+Enter mapped to:
ClassViewContextMenus.ClassViewMultiselectProjectreferencesItems.Properties
Have your tried mapping Shift+Enter (or whatever) to that command?
Tools->Options->Environment->Keyboard
You should be able to get it all working from there.

How to assign keyboard shortcut to open a solution folder from visual studio?

I'm trying to assign a keyboard shortcut to open a solution folder (the one you get when right click on solution name) from Visual Studio. Looking in keyboard options in Options didn't help (searched for "folder", for "open" etc.)
Have I missed something ?
This is it:
ProjectandSolutionContextMenus.Project.OpenFolderInWindowsExplorer
It works, but I'm sure how you get the solution selected first?
Please let us know if you can solve it elegantly, I'm interested because I don't currently use AnhkSVN or VisualSVN, I prefer TortoiseSVN, but it would be nice to open the solution folder since that's normally the root.
You can assign a keyboard shortcut to a macro using this example
Assigning a Keyboard Shortcut to Macro in VS
Last time I forgot to mention one
important thing - how to assign a
keyboard shortcut to your macro. Often
you don’t need any button for your
macro, the shortcut is enough. Or you
can have both. As I already wrote,
macro is similar to any named command.
So to assign a shortcut to it:
Go to menu Tools - Options… and select Environment - Keyboard.
alt text http://www.helixoft.com/blog/wp-content/uploaded/keyboard_options.png
Find your macro in the list of commands. All macro names start with
“Macro.”. To filter out other commands
enter your macro name in the Show
commands containing field. If your
macro is named test as in our example
then type test. Select your macro.
Go to Press shortcut key(s) field and press your shortcut. If the
shortcut is already in use, you will
see it. Press Assign button.
Remember that you cannot change or
assign the shortcut if you are using
predefined keyboard mapping scheme.
You will be warned in this case. You
must create a copy of current scheme
and use that copy. Press Save As…
button under Keyboard mapping
scheme and give it some name. Then
select this new scheme.
There probably isn't a keyboard shortcut defined for that, but Visual Studio has excellent macro support, and you can create your own macro to do that.
There's a Macro Recorder feature that you can use. This MSDN article explains how to use the Macro Recorder.

Resources