Sometimes I open multiple projects and files and copy paste code from one project file to another project file. Here’s a sample.Ī lot of time I copy and paste code. Say you place your cursor in the middle of the code block and hit the key combination it will copy code from opening braces to closing braces and so on. When I say intelligently I really mean it. When you press **CTRL+W **it will select the code next to the cursor and will continue to select intelligently. Any one? This shortcut lets you select a word, block or comment without touching your mouse. Raise your hand if you never had to copy paste the code.
Here comes your knight in the shining armor – **CTRL+P. **This will tell pull up a callout with the information you need. However if you are like me who forgets the fourth and then next parameters, you would be pulling your hair out. One ugly way of doing is use your mouse and place the cursor at the beginning of the open bracket and wait for a second until the highlight shows you that the third parameter that you need to pass is a String variable. ,) and you forget what was the third parameter that I need to pass. You start by typing – M圜lass.someMethodWith10Params(. Imagine you are about to call method which accepts 10 parameters. Argument Documentation For Method Calls: CTRL + P For example – Are you sure you want to delete this folder? (Y/N)Ĥ.
Simply place the cursor on the beginning of the line and hit CTRL + Y. Now it might not seem intuitive because the obvious choice of deleting should have been CTRL **+ D **( It actually adds a new line if you wondered what it does) but a cool way to remember is to think about confirmation dialog boxes in Unix. If you have any vim experience or have used sublime text in the past then this would come easy. To compare the difference, I have commented the same code using **CTRL+L and / + Enter So if commenting single line was not cool enough for you then you can use this to create documentation comments or comment out the code without ugly // marks showing at each line. What are you conveying or trying to do in a particular method? I hate when I come across such code or even my code when I was beginner. One of my biggest pet peeves is developers not documenting about a method or sub routine. I may not follow other coding standard but I do follow this – “Leave the place cleaner before you leave”. Documentation Comment Block : / + Enter** A cool thing to know is that you can comment out multiple lines at once.Ģ. Instead of manually going to the beginning of the line and manually typing //, you can use the keyboard shortcut CTRL + L. You will often run into situation where you need to add debug statement temporarily and remove or comment the line after the debug is complete. I am sharing my 10 most used shortcuts at work. I have to say that not only have these shortcuts increased my productivity but they have also made my life a lot easier. I admit that I am not a shortcut junky but I too have some keyboard shortcuts under my sleeve that I use in day to day work. Linux nerds/geeks happily flaunt their keyboard skills when they get a chance.