Search for things faster in Visual Studio with these two weird tricks

Here are two ways to search within a document that won’t open the search dialog in Visual Studio 2010. The first one is also useful for 2013.

Incremental search (Ctrl-i): Ctrl-i will start an incremental search. In Visual Studio 2010 this won’t even open the search dialog. Your search pattern will be displayed on the bottom bar in 2010 and in the standard search box in 2013. You can cycle through various entries by continuing to press Ctrl-i.

I often use incremental search to quickly jump to a specific location on the same line or a nearby line. For example if I want to jump to the word string I can just press Ctrl-i followed by the first few characters of the words I am looking for, in this case: st and I’m usually there. By using this feature I am able to prevent using the mouse or the arrow keys to move the cursor.

This is a big gain as taking your hands away from the keyboard has a huge impact on your workflow and the arrow keys are a slow way to move around (even with shift-arrow key).

Keep in mind that as the distance you need to travel increases, you’ll tend to get more and more misses with this strategy and might need to keep repeating Ctrl-i too much.

Search for the word under the cursor (Ctrl-F3): This next one is specific to Visual Studio 2010. If you want to find other occurrences of a specific word just move your cursor to it and then press Ctrl-F3 which will automatically send you to the next occurrence. Again this will not bring up the search dialog, which would then necessitate at least one more click to confirm.

You can continue pressing F3 (no need for the Ctrl key) to move to the other occurrences of the same word within the current file.

This is particularly useful when you are already positioned on the word you want to search, say a variable or function, and contrary to Find all references it will also find commented out instances.

In Visual Studio 2013 search has been improved which rendered this shortcut obsolete. You can still press Ctrl-F3 which will have the same behaviour has Ctrl-F. F3 will also cycle to the next search hits.

In the same series:

Delete things faster in Visual Studio with these two weird tricks

Delete things faster in Visual Studio with these two weird tricks

Here are two nifty keyboard shortcuts in Visual Studio:

Cut whole line (Ctrl-L): This will cut/delete the whole line and send it to the clipboard. This is useful in two situations.

First, it let’s you remove a whole line in a single action reliably.

For white space lines, depending on the line configuration, using delete or backspace might necessitate more than a single key stroke per line. Ctrl-l always does it in one action.

For non white-space lines Ctrl-l prevents you from having to select the whole line and then deleting it, saving you again one action. Every action saved counts.

The second situation is when you want to select a whole line, cut it, move and then paste it. With Ctrl-l you can reduce this from 4 actions to 3.

When using Ctrl-l if you overwrite your current clipboard you can do a Ctrl-Shift-v to cycle through your clipboard history.

Delete next word (Ctrl-Del): This is a universal shortcut that works for many programs but I have included it here since I learned about it recently. This will delete the whole word in front of you instead of just a single character.

In the same series:

Search for things faster in Visual Studio with these two weird tricks

Go and Rust, not Go versus Rust

In the last few months I have been playing around with Rust, Mozilla’s new systems programming language. I worked on small personal projects and submitted a few pull requests (mostly refactoring) to Servo, a Mozilla research project to build a browser engine in Rust.

Another language that often gets mentioned alongside Rust is Go, also known as golang since Go is hard to search for (so is Rust to a lesser extent).

Both languages are compiled, static, strongly typed and have pointers. Both are at a lower level than popular languages like Ruby or Python. They both have been called systems programming languages though this description fits Rust more than it does Go.

I have often seen people asking which one is better or which language should be chosen over the other.

Because of this appearance of opposition and the fact that I already knew Rust, I decided to try Go and see if and how the languages were similar.

Initial impressions of Go

My initial impressions of Go are very good. The language is easy to learn and is nicely designed. If you know any of the following languages; C, C++, Java or C# you’ll be able to jump right in after reading a short tutorial.

The tooling is great, particularly gofmt which formats your code automatically according to the Go style guidelines. I’m using a Vim plugin for Go which calls gofmt each time I save. This process is very nice once you start using it.

One downside is how the package/module/directory structure needs to be set up. It’s not clear when your first start how everything must be structured. It’s important to read this part of the documentation before starting your first project. Otherwise you’ll end up like I did, needing to rearrange the file structure of my git repository because I didn’t follow the proper structure.

Even now that I know the correct file structure I still find it a bit odd and constraining. It’s definitely not one of the language’s strong point.

Comparing Go and Rust

While both languages may seem to serve a similar purpose at first, upon using both they are very different. I have seen many people asking which one is better but the answer depends on what you are building and what you are looking for in a language.

Go is easier to learn. There is deliberately less features in the language and you can hit the ground running after a short tutorial.

Programming is also easier. I spent more time solving problems with my algorithms than I did wrestling with the language.

Go is also garbage collected. That means less to worry about as you don’t have to manage memory. On the other hand, for some applications a garbage collector can be a big downside and it does mean less control.

Rust on the other hand is a more complex language. There is a lot of interesting things in the language and if you’re a language nerd you will love a lot of it’s features. This makes learning and mastering the language harder than Go, but it also makes for a powerful language with a lot of expressive concepts like meta programming through syntax extensions.

I have spent a lot of time battling with the Rust compiler. Compared to Go this means I spend more time solving problems related to the language itself rather than to the algorithms I am writing.

One thing I must say is that when a program finally does compile, there are much less run time errors than in any compiled language I have tried before.

The language isn’t garbage collected and also allows for more control like choosing if memory is allocated on the stack or the heap for example.


Go is a general purpose utilitarian language that’s suitable, amongst other things, for building tools and app back-ends.

Rust is a “PHD smarts” language that’s better suited for systems level stuff and programs where memory management and performance is important.

Go will probably become a go to language when I need a compiled portable low-level language. It’s more modern than C and it’s simpler than C#.

Rust on the other hand is more specialized and is a better choice when doing systems level programs, when garbage collection isn’t an option, or when performance is critical.

Both are wonderful languages and I intend to use them both going forward.