Showing posts with label productivity. Show all posts
Showing posts with label productivity. Show all posts

Friday, 12 April 2013

Productivity: Two command-prompt time savers

Recently while watching pluralsight.com videos I noticed that the authors use a console window which allowed them to select and copy text using mouse. And they also had auto-completion for files/directories. As a developer, we work a lot with console applications now and then and having these two features should be a huge time saver.

1> Text selection, copy and paste

Normally we have to click Edit –> Mark –>  Select text –> Press Enter, but there is a quicker way!

- Right-click the title bar and click Properties.

image

image

 

 

 


 

 

 

 


 

- In the Options tab, look for “Quick Edit Mode” and enable it.

image

 

 

 

 

 

 


 

With this setting, we can use left-button mouse to select text and then right-button click or ENTER to copy it. And to paste something, we can click right-button.

image

 

 

 

 


 

 

 




2> Auto-completion for files/directories:

For the auto-completion we need to modify the registry. The steps are:
- Open regedit.exe
- Look for HKEY_CURRENT_USER\Software\Microsoft\Command Processor
- Change the value of CompletionChar to 9.

image

 


 

 

 

 




 

On my computer this was already set to 9, it could be different on yours. Using screen shot I cannot show you how it works, but start by pressing [TAB] on console and it will iterate the directories/files one by one. And when you type in ‘CD D:\[TAB]’ then it would again do the same thing for D:\ drive.

You can also type in a letter, say ‘w’, and then press [TAB] – it will one by one go through all the items in the folder which start with ‘w’.

Hope knowing this saves a few minutes of your life.

Friday, 30 March 2012

Code snippets in Visual Studio

I must admit I was not a big user of snippets in programming. I used a few because they popped out in intellisense - for example while writing a for-each loop the snippet "foreach" comes up and we intuitively use it.

Never looked deeper to find other snippets. Today I realized I was at a big loss by not using them! Now I am never going to declare a property with all the key-strokes or writing if-else without using snippets. The no. of key strokes required are so less that it will improve developer's productivity by a good margin.

A few I like:
- mbox: If I use only this one it will save a lot of time for me.
- else: This one popped up in intelli sense but still didn't use it. 3 key strokes with snippet and 11 without
- prop: for automatically implemented properties
- ctor: for spitting out the constructor
- svm: for static void main

Other useful ones are 'surrounds with' snippets. Among these I like "try" which surrounds a code block with try-catch statement. What a time saver!

And another cool thing is we can add our snippets, it's just editing an XML file some where. I will see which ones are missing and add on my own. Should be fun.

(This reminds me there is so much still to learn and that even the smallest of things can be of BIG use)

Shorts - week 3, 2022

Post with links to what I am reading: 1. A very good post on different aspects of system architecture: https://lethain.com/introduction-to-a...