I'm trying to find anywhere that I can achieve this. I simply want to setup a macro like in sublime text or atom where I can hit shift+enter and it will go to the end of the line, add a semicolon, and bring me to the next line. I've just started C development and trying to use vs2013 and not having this is pretty much going to send me sprinting back to sublime text, intellisense isn't worth destroying my workflow.
I've tried: Tools > Options > Environment > Keyboard > Text Editor : Shift + Enter > Edit.Breakline As suggested by someone in a vs2010 thread but that proved fruitless.
Any assistance would be appreciated.
The command is Edit.LineOpenBelow. It's already assigned to Ctrl+Shift+Enter
I had the same issue, so I swapped the commands for Ctrl+Shift+Enter and Shift+Enter.
Shift+Enter is assigned to Edit.BreakLine by default.
Related
I've just started using Quarto for first time in RStudio (I usually use Rmarkdown).
In Rmarkdown, I could select a line from a code chunk and use Ctrl + ⏎ to evaluate it in the global environment. This was useful because it let test the behaviour of a line without requiring me to knit the document or run the entire chunk.
This shortcut does not work in Quarto documents in RStudio. Is there different keyboard shortcut which will let me a evaluate a single line from a chunk of code in a Quarto document?
Edit: some people are saying that the old shortcut should still work, so maybe this is a bug? I'll update this question when I know more (or perhaps delete the question and submit an issue should the need arise)
Currently using
R version 4.2.1 (2022-06-23 ucrt)
RStudio version 2022.07.1+554 (Spotted Wakerobin)
This is an RStudio bug on Windows 10
There's a known issue with Rstudio and the Quarto visual editor where pressing Ctrl + ⏎ from a 'floating' window results in no code being evaluated, or code in a different window being evaluated. It's part of a wider bug where the connection between floating windows and the main window is severed.
The issue is due for repair in 2024. Until, then you'll need to do the following to restore normal shortcut functionality:
'Re-dock' the window you're editing using the 'Return to main window' button:
Close all other 'floating' windows
Restart RStudio. Close the process completely; restarting the session will not work.
I have ctrl+f2 mapped to toggle bookmark in my vscode keyboard shortcuts.
{ "key": "ctrl+f2", "command": "bookmarks.toggle", "when": "editorTextFocus" },
It work correctly on Linux and Windows, but not on macOs.
I have enabled the setting to switch function keys (f1, f2, etc) to behave as standard function keys.
I have then unmapped ctrl+f2 in macOs keyboard shortcut settings.
But still ctrl+f2 keyboard shortcut is not registering with vscode.
Troubleshooting VS-Code Keybinding Issues
The best way to troubleshoot an issue with Keybindings in V.S. Code is to use the tool that was created for solving keybinding issues
The tool is simply named: "Keyboard Shortcut Troubleshooting Tool"
The tool comes with V.S. Code "out of the box", as a result; no downloading, or installation is needed. To use the tool you just activate it from the Quick Input Menu that drops open by pressing the F1-Key. If you cannot find it your self I posted instructions below, and an image. If you can find it yourself, then skip the "Activating the Troubleshooting Tool" Section, and go ahead and read, "Effectively Troubleshooting Issues with the Troubleshoot Keyboard-Shortcut Tool"
Activate V.S. Code's Troubleshooting Tool
Hit the F1-Key
When the quick input drops open type the following into the text input:
"Toggle Keyboard Shortcuts Troubleshooting"
Select the option: Developer: Toggle Keyboard Shortcuts Troubleshooting
It should automatically open the OUTPUT panel, which is located in the same panel that your terminal is. Make sure that the OUTPUT is set to LOG(Window) in the drop down. (I took a picture and posted it below if you can't find the Keyboard Shortcut Troubleshooter).
The image might have funny declensions because I am on a dual monitor setup with 1 1080x1920 curved screen and one 1080x720 screen.... I cropped it to a STD HD 1920 width.
HELPFUL SIDE NOTE:
"This tool may be the most verbose program ever written, as far as I can tell, it logs data to the OUTPUT Console each & every time you activate a keyboard event. Truth be told, I find this tool to be extremely distracting, and very annoying. Because of this, it is important to note, that even if you switch out of your OUTPUT console to your terminal or something. The Troubleshooter is still actively logging to the OUTPUT Console. Make sure when you are finished to turn it off."
Turning off the Keyboard Troubleshooter, requires the same process as turning it on.
Using V.S. Code's Troubleshooter
STEP-1: Close VS Code
This is not to be confused with reload V.S. Code. The only mechanism that VS-Code has for reloading its-self, doesn't provide the same functionality as closing, and reopening V.S. Code. The two are similar, but they are not equal (discussion for another time).
actually stop its process from running by hitting the X in the upper right corner of the title-bar, or hit
**[Alt + F4].
Step-2: Reopen V.S. Code W/O Any Extensions
Don't worry, you won't have to uninstall anything. You will start V.S. Code from the command-line though. Open up your bash terminal, or Powershell, and enter the following command:
$ code --disable-extensions
V.S. Code should start almost immediately
If the V.S. Code CLI doesn't open your editor, or this doesn't disable your extensions, you should refer to this link
Step-3: Start the Keyboard Shortcut Troubleshooter
I already explained this step above, so their is no reason to go over it again. Do make sure you have your panel open, and the OUTPUT tab is selected. You should see a bunch of logging being output, in the VS-Code output (that is redundant sounding), logging when you use any keybinding. The drop-down should have Log(Window) showing, as the current log selected.
Step-4: Test Your Keybinding
At this point you can use your keybinding, and get results. They might not be the results that you were hoping for, but the troubleshooter should give you details as to what is happening when you use your keyboard shortcut (aka bound-key, aka key-binding).
Step-5:
Fix the issue by opening the Keyboards Shortcuts configuration file by opening the quick input, (like I described above for the troubleshooter), and type Keyboard Shortcuts. Their will be two options, one is the default Keybindings that cannot be written too, the other is a configuration file, where you are allowed to overwrite all of the default keybindings if you choose. Look in the default keybinding.json file and make sure the keybinding that you feel is assigned to a certain task, really is assigned to it. Look in the regular keybindings.json file, and make sure if anything is written in it, that those keybindings are not affecting the keybinding that is not working for you. Use the information from the troubleshooter to help guide you through the process.
These links below further elaborate on V.S. Code keybindings:
V.S. Code Community Docs (Community Contributed)
V.S. Code Official Docs (Keybindings)
I've been using Rstudio for a few weeks now, and the tab completion has worked inconsistently for me. For example:
my_variable = 10
my_va
Those are the only two lines in my R-script. When I press tab to use completion, a small message appears next to the text bar saying "(No matches)", when I believe it should find the matching variable called "my_variable" in the line above.
Does anyone know how to use tab completion in Rstudio?
RStudio looks at the workspace and the packages loaded to try to do the tab-completion. If you haven't run the first line then RStudio won't recognize that you want to complete to "my_variable".
If you run your first line then RStudio will be able to tell that you have a variable called my_variable and will offer to complete it to that.
You can read a little bit more in the RStudio documentation.
I'm building some code completion style text expansion functionality for text areas and inputs in a web application. I'm trying to work out a safe keyboard shortcut for invoking the completion proposals for browsers running on Mac OS X.
I've eliminated some potential candidates:
Command + Space - activates the Spotlight search field
Control + Space - activates the context menu in Firefox
Esc - cancels any background XMLHttpRequests in Firefox
That leaves Option + Space. I'm aware that may conflict with tools like Ubiquity, but that's something we don't expect our audience to be using.
Are there any conflicts I may have missed with Option+Space? Or do you have a better idea for a keyboard shortcut, and why?
A lot of Mac OS X apps use Option + Esc to do code completion or code hints.
Some kind of tab shortcut sounds like the best and most intuitive approach - users should be used to the 'type-tab-type-tab' workflow - maybe combine it with a modifier if it only wants to be optional.
As I recall, Visual Studio and TextMate both use tab to code-complete. In Visual Studio an intellisense menu pops up as you start typing and tab acts as the selection confirmation.
In TextMate, you start typing part of a command then hit tab to activate said command's associated "bundle". The associated bundle typically generates a code snippet and fills in any dynamic parts of the snippet as you type.
Come to think of it, most command lines work this way as well, auto-completing file names and paths when tab is pressed after typing a few characters.
EDIT: You say tabs are needed for field switching in a web interface, but you may want to try intercepting the keyboard event in the textfield, and check if they're started typing a macro. If they have, auto-complete and swallow the key by returning false; if not, simply let the command bubble through.
I discussed these ideas with our design team. One of them suggested using Control + Enter, which is what we decided to go with. This causes forms that only contain a single input field to automatically submit in Firefox, but we deal with that by preventing the default action caused by the event.
I re-assigned the Spotlight command to Command + Shift + Space. This is easily done via Prefrences.App
Duplicate:
How to indent a selection in gvim (win32)?
How do I indent multiple lines quickly in vi?
Using vim under linux I can indent a block of code using the VISUAL mode and pressing ">".
In vim under Windows this does not happen.
This is what happens:
Press V, the VIM enter in the VISUAL mode
Press 'Down', the VIM exit for the VISUAL mode. I can't select anything in VISUAL mode.
Alternatively, if I use the SELECT mode for selecting code the ">" does not indent it.
Haven't you keep mswin.vim ? If you want the same behaviour on both OSes, get rid of this file.
Ok, I got it. In Windows I should press Shift+Down to remain in the VISUAL mode.
If you use V (uppercase) you enter VISUAL LINE mode. For VISUAL mode you should use v (lowercase).
And if you use the standard movement keys (hjkl) everything works fine.
If you dislike the default movement keys, use these mappings:
:map <Up> k
:map <Down> j
:map <Left> h
:map <Right> l
Weird, I don't experience this behavior on Vim 7.1 on Win XP. Perhaps setting nocompatible will help you?