I want to be able to move the cursor (not move the line of code) in the text editor up a block or down a block by pressing <ctrl>+<uparrow> or <ctrl>+<downarrow>. In jEdit, Leafpad, etc, this just works out of the box. I do not want to move an entire page at a time, just simply go to the start or end of the text block that I happen to be on.
Specifically, I want this, but for VS 2012 (which no longer has macros):
keyboard shortcut to move from one code block to another in VS2008
I've seen these posts, and they are not what I'm after; I do not want to move code, I want to move the cursor to the top or bottom of the block I happen to be on.
Visual Studio: hotkeys to move line up/down and move through recent changes
Visual Studio - Scroll AND move cursor
I have checked in ReSharper as well, and cannot seem to find an answer there.
Does anyone know of an add-in that provides this functionality?
Bind them to Edit.PreviousMethod and Edit.NextMethod in the Options->Environment->Keyboard?
I removed everything that was bound to these shortcuts, then bound it to Edit.PreviousMethod and Edit.NextMethod. This put the focus on the method box in the editor, but then you have to press enter to get it to navigate to that method.
The best I could find was using ReSharper, which I was trying to avoid. However, I'm a minimalist and ReSharper got in my way, I was leaving it toggled off almost all the time, so I uninstalled it.
I believe it was ReSharper.MoveToNextMethod or .NavigateToNextMethod, but I have uninstalled it so I'm going on memory. Using it, it would jump to the beginning of the previous or next method, which was not quite what I was looking for, but better than nothing.
Edit: I gave up. I moved to .Net Core for c# code and do all my editing outside of Code, using text editors that employ common keyboard shortcuts like Geany, jEdit, etc.
Related
When previewing a file by clicking on it once in VSCode, is it possible to preview other files in the explorer by using the arrow keys, similar to Visual Studio? When I do it, it just selects the file, but doesn't preview it (unless I use my mouse). I'd provide a picture, but the upload isn't working right now, sadly. :(
I feel like that used to be a thing and I broke it at some point, but I could also just imagine it due to VS.
https://stackoverflow.com/a/66237216/12903844 has exactly what I was looking for!
Short summary: Up/Down + Space will enable you to preview a file, but you can also use 'multi-command' to macro it to just Up/Down (without having to press Space when selecting files this way).
Credit goes to Mark for answering it in the comments, just adding it here so the solution is marked. <3
I would like to demonstrate the problem I am having via this video on my google drive: https://drive.google.com/file/d/1RcDn1UQtbcWwILkaDaf5MgI-5PL6NS0-/view?usp=sharing
Part 1 of the video) I do not do anything with the method menu for a moment so I may attempt to read its information. Something happens that causes it to close.
Part 2 of the video) I try to see if I can use my mouse to try and select from the method menu. However, something also happens that causes the method menu to close.
Part 3 of the video) I am trying to quickly use the down arrow key to browse through the options, but some process seems to happen as my cursor turns into a loading circle, causing me to actually go down lines of code using the down arrow key.
I have never encountered this before, and I am not sure what is causing this. There were a few times earlier today when I could use the down arrow key and leave the method menu on for a bit to read more information and things seemed fine for a moment, and then there are other times like these when the method menu is disappearing on me. I'm not sure how to search this up because I'm not really sure what appropriate terminology I should use when trying to see who else has had this problem.
I am using Visual Studio Community 2019, version 16.9.4 with the .NET Framework version of 4.8.04084
I've used Visual Studio for years and have just started work on a C++ project in XCode, and I'm finding some aspects of file navigation in XCode frustrating.
If I have several files open, and I use the mouse swipe left or right to reveal a previous/next file, the editor always repositions the window to the top of the file, instead of where I was looking at it previously. Is there any way to keep the file positioned at previous line?
In Visual Studio I often used bookmarks within a file, and then keyboard shortcuts to move forwards and backwards through them. Is there an equivalent in XCode?
Is there any shortcut to show a list of the currently open files so that I can view one of them? (I miss the Visual Studio tabs.)
I have the same complaints and have not found a good solution, but there are a couple of things I have done.
I have placed commented out keywords throughout my code. For example, when I was implementing iAds into my project I added "//iads imp" into my code, thus I was able to quickly do a command+f and type in "iads imp" and I would go to that section of code.
The other solution I use for this is pragma marks:
According to this site,
"Pragma mark is simply a way to organize your methods in the method list pop up button in Xcode "
I am using a notebook without a mouse.
After typing prop and pressing tab, Visual Studio will automatically give me a property template. Pressing tab will move the cursor between type and propertyname placeholders.
I want to move the cursor to a new line after completing the property template.
Is there a shortcut to do so?
Press the Enter key twice.
I tried to post this answer 3 times before I left the comment. It wouldn't let me, too short. That's why I'm typing this otherwise useless verbiage.
It's not specific to snippets, but you can press Ctrl+Shift+Enter to start a new line below where the cursor currently is.
To insert a new line above where the cursor currently is, use Ctrl+Enter.
Both of these work anywhere in the editor. Both of these are handy because they work no matter where you are horizontally on your current line.
Update: Productivity PowerTools for VS2010 (Woot! 2012 too) provides the keyboard shortcut Tools.AddEndTokenAtEnd. (Thanks Ben.)
For some reason, magically, my VS2010 does this with Shift-Enter (which I prefer from my experience with TextMate.) Looking at my keyboard bindings (Tools > Customize > Keyboard) I see that this shortcut is assigned to the command Tools.AddEndTokenAtTheEnd. So if that command appears in your list of commands, assigning a keyboard shortcut to it should work. I have Productivity Power Tools, PowerCommands for Visual Studio 2010, and ReSharper installed. But I can't find any setting from the first two that would be responsible, and, in my experience, all of ReSharper's commands contain its name, so I don't think it added the command. Ooo, and I just discovered that the reason it is named that is because the command also ensures there's a semicolon at the end of the initial line before moving the cursor down; just like the useful keyboard shortcut in Textmate.
I'm interested, but baffled by the 2x-Enter solution. When I press enter twice I get two line breaks followed by whatever code was after the cursor on the first line. Can anyone explain how that shortcut/key-combination works? Is it time-sensitive so that the two enters must be pressed in rapid succession? What if the user wants to quickly insert some lines above some code and hits Return multiple times!?
This may or may not be specific to VS2005 (as that is the version I'm referring to for this question).
I find often the case is that I see this in the Output panel inside Visual Studio
2>Build log was saved at "file://c:\\vsdll_example\MyExecRefsDll\Debug\BuildLog.htm"
Now, since that looks and smells like a URL, I would have thought that I could simply left mouse click on it, or left mouse double-click on it, and a browser window of some sort would be displayed. No, that doesn't work. So, to view it, I have to cut and paste the "file://bla/bla/bla" part into an external window.
Is there a way to set up Visual Studio to allow me to browse to that file directly, or view it inside Visual Studio IDE, or something to that effect, without the extra fiddling with cutting and pasting? Or is there some type of keybinding I'm not aware of?
Thanks,
bg
Hold down Control while clicking on the link. It should show up in the editor.