Visual Studio Tips

Throw away your mouse while browsing the web – Into to Vimium

Posted by matteskolin on

I’m always looking for ways to use the mouse less.

Get the extension here.

https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en

This extension for Chrome allows users to have a vim-like experience while browsing the web.

Some Things I have discovered so far…

How to leave the address bar to return to command mode on the page without a reload (enter -key)
https://xavierchow.github.io/2016/03/07/vimium-leave-address-bar/

o – The o command is good if you are navigating to a new website, but the auto-fill is not as good as the chrome address bar for visiting sites you visit often. For now, I am continuing to use the chrome shortcut <Alt + D> to access the address bar.

Visual Studio Tips

Code Folding in VS Code1

Posted by matteskolin on

Efficient code folding is an important part of productivity when writing code. Folding is part of the larger and more complex task of code navigation. Folding helps in several ways when working with a single file of code.

Being able to see all the method names at once helps with rearranging methods so related methods are near each other, which improves code readability.

Folding methods or classes you aren’t actively editing helps me keep my focus on what I’m actively working on, so I don’t get tempted to do too many things at once, which can hurt productivity. For example while writing a new method, I may notice some other methods that need refactoring, which leads me to database procedures which I want to optimize, which leads me to wanting to change the formatting of the results.

My favorite command for folding in VS Code is the (Control + K, Control + 2) command. Here the 2 means to fold all regions at the second level, while leaving region 1 and regions greater than 2 unfolded.

In many C# files, (Control K, Control + 3) will collapse all method definitions, because methods are usually at the 3rd level after (1) Namespace, (2) Classes.

namespace folding_example_LEVEL_1
{
    public class folding_example_LEVEL_2
    {
        public class folding_example_LEVEL_3{

        }

        public void folding_Example_LEVEL_3(){

            if(true)
            { // LEVEL 4

                
            }

        }

    }
}