in previous versions of Visual Studio, you could collapse the html blocks, but that appears to be missing in VS2012. Any ideas on how to enable that feature again?
I was having this issue too and it was driving me nuts. Turns out that, somehow, I turned off "Automatic outlining" which meant that I did see the plus/minus signs and the shortcut Ctrl + M + M didn't work either.
After I turned on Automatic Outlining in Edit > Outlining > Start Automatic Outlining everything went back to normal.
NOTE: On some ocassions, for this solution to work, you also need to close and reopen the document before clicking on Start Automatic Outlining. In fact, sometimes that option doesn't appear in the menu if you don't do so.
It's still there. The issue is that sometimes it takes a while for the parser to visually enable collapsing.
Try Ctrl + M + M and you'll see the effect
I prefer using Ctrl + M + H whenever I want to hide unwanted code irrespective of any tree hierarchy. This works great even if I want to hide my commented code.
You just need to select the code that you want to collaspe and hit Ctrl + M + H and its hidden now :)
When you open the font .cshtml, you will have go to EDIT->Outlining->Start Automatic Outlining
Just hover your mouse on code editor and wait a moment, don't move your mouse :)
The outline tree will show out.
before and after
right click on html, cshtml or aspx file in solution explorer and select open with option:
in dialog select html editor and click on set as defualt button.
open html or cshtml or aspx file and enjoy html file with outline html tag.
:)
Related
Trying to perform the Ctrl + G (Go to line) keyboard shortcut, seems I accidentally activated a feature that pins the code the cursor was previously on.
After closing and reopening the file, things are worse; the code snippets still are floating over the screen, no matter if I move the Android Studio window.
I have searched keyboard shortcuts using this guide, but no luck.
Is there a way to disable or revert this?
Noticed by comment below and confirmed by myself: This happens after extracting a method.
I have been able to get rid of those permanent tooltips by invalidating caches and restart, but this should not be the way to disable them, as I still don't know which is the keyboard shortcut to toggle this "pin snippet" function.
I've searched throu lots of articles but not found an answer, some has come up with workarounds but not really answered the question.
I want to locate a file in the project view over the files in Android Studio.
There is in the project view a button named scroll from source, this one does what I want. But I want it as a keyboard shortcut, like the command in Visual Studio many has as shift alt l. The resharper command is locate in solution explorer
There is also an option in the project view to mark always scroll from source.
These options are useful but do not solve my question.
One might think this would do it, but I don't want the project view over the files to scroll up and down all the time. I want a keyboard short cut because that is what feels fastest to me to work with and makes it more comfortable.
It's possible to achieve this by typing Alt + F1 followed by Enter. If you want to change that to one button press then your best bet is to record those commands as a macro.
To do this go to Edit > Macros > Start Macro Recording. Then press Alt + F1 followed by Enter. Then go to Edit > Macros > Stop Macro Recording and give your macro a name when prompted. Now that your macro is saved you can assign a key binding to it. Go into Settings > IDE Settings > Keymap > Macros and there you will find your macro which you can then bind.
It didn't seem to work for me unless it was a single keypress so I bound the macro to F10.
The problem
Yeah, so I am having quite annoying problem where to I have not been able to find any solution from Google. The problem comes up in both situations starting up a new project or opening up old working one, all I get is emptiness everywhere, see picture below.
What i have already tried
I have tried reinstalling the whole program couple times and I have patched it.
Picture: http://i.imgur.com/XqJgwKJ.png
The solution explorer may not show up by default. You can show it with:
Application menu: View > Solution Explorer
Shortcut: Ctrl + Alt + L
I think you just don't have your solution explorer open and visual studio doesn't open any file by default.
The solution explorer shows you all of the files and folders in the current solution and let's you open them.
Open it using View > Solution Explorer or press Strg + Alt + L.
In Visual Studio 2012 the find and replace window has Docking alignment to the top right side, how to release it?
The "quick find" window isn't docked in the usual sense. Press Esc to dismiss it and also make the yellow-orange search result highlighting go away.
Alternatively, click the X in the top right of the mini window.
Edit.Find = docked Find window
Edit.Replace = docked Replace window
Edit.FindinFiles = undocked Find window
Edit.ReplaceinFiles = undocked Replace window
so for undocked windows you can press Ctrl + Shift + F or Ctrl + Shift + H
or alternatively change shortcuts in Options > Environment > Keyboard to reach desired windows easier.
This is not possible unfortunately, which really drives me nuts when trying to find something in a minified file (single line) since the find window commonly blocks the found result.
Last post I could find about it:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/3636907-let-me-undock-the-find-and-replace
The best solution I can find is copy and past file into notepad and find there (for my needs).
In Visual Studio 2012 all docked windows can be released as follows;
Docked Window's Header right click menu (or click Window Position Icon what located the far right of the header)> Float menu
If the usual things, as already suggested, won't work, here are two other ideas I have found to work with oddities in Visual Studio.
Disable all plugins and try again (had a weird case of VS crashing on Ctrl+S and it was a faulty plugin)
Try a repair on the install, could have some faulty files.
I know how to navigate to a file or a class, but can I navigate to a class's method?
Oh and say I am viewing a different class's file
With respect to my correctly configured keybindings, all of the previous answers seem outdated/invalid to me.
I say:
Hit Alt + \ to list all file members.
Then find your method in the list and navigate to it.
If you use "Resharper 2.x or IntelliJ IDEA" keyboard scheme:
Ctrl + Shift + Alt + N -> navigate to symbol
In Visual Studio Scheme:
Shift + Alt + T
For future reference and other options check https://www.jetbrains.com/resharper/features/navigation_search.html
If you are using Resharper IDEA Scheme, do ctrl + F12 and you can enter a member name, fastest way to navigate to a method, property etc on that file
Ctrl + Click (or Right Click > Go To Declaration). Works on Methods, Fields, Properties, Types, and just about everything else.
With VS2015 and ReSharper 10 press Ctrl + T. This will search for types, symbols and files. It will search through everything in your solution.
Update: works the same in VS2017 and ReSharper 2017.2.
You can also press Ctrl + T followed by / mm to search for just methods.
Another tip for the current file is to use the File Structure window - can also drag and drop members around from the window.
I have used Dpack (f/oss) for years and it can go to methods and/or properties by pressing a shortcut and then start typing. For those who get Resharper's ctrl-T working it is like that one but within the file.
Dpack provides the same functionality for finding files and open files. The former is a better version of Visual Studio 2015's ctrl-;.
(I have done some remapping of keys too but in my experience something (resharper?) overwrites my changes from time to time.)
(Also with VS2015 and R#9.2 I think Dpack does a better job at this.)