- Joined
- Nov 14, 2008
- Messages
- 1,025
- Reaction score
- 641
I believe knowing how to navigate code quickly and efficiently is an important skillset a programmer must have to work with haste. In this thread, I will go over some of the ways you can learn to get your cursor where you want it to be faster than with a mouse.
In this post, I will assume you don't use Vim or any of these funky command line editor that have a 2 years and up learning curve.
Knowing the shortcuts to move around in your IDE and text editor is very important. Some common shortcuts that will help you work faster in Eclipse IDE but that should be available in most decent softwares
Software unique shortcuts
Duplicate line (Ctrl + Alt + Up/Down)
This is actually something unique to Eclipse, having the ability to duplicate a line not only down, but also up. It may not look like much at first but whenever I work out of Eclipse, I'm always bothered sometimes by the fact that I can't duplicate the line up rather than down.
Move line (Alt + Up/Down)
Extremely useful shortcut that helps moving lines around rather quickly.
Delete line (Ctrl + D)
How many times have you done this before; putting your cursor at the beginning of a line and then gently move it to the end, which is not only tedious but slow, to finally delete it? Incredible amount of time to be saved with this one.
OS wide shortcuts
Ctrl + Left/Right - Move between words. The shortcut I abuse the most out of everything here. The day I learned this I cried that night.
Ctrl + Backspace/Delete - Delete previous/next word. Second to most abused shortcut after the last.
Ctrl + Shift + Left/Right - Move between words but combined with the shift modifier, it will also select the text. Rather useful too.
Home/End - Go to the beginning/end of the light. This is the latest shortcut I've been trying to incorporate in my toolset. It can be useful at times!
Shift + Home/End - As with the other shortcut to move between words, this will select the text as the cursor moves to the end or beginning of the line. I actually use this shortcut more often with shift than without.
The overtype mode
One thing that is often overlooked is the overtype mode. You enable it by tapping the Ins. key on your keyboard. It makes it so that typing overwrites the text where the cursor is rather than inserting it. It's rather useful when you have to duplicate one line of code in particular where you don't have to change a whole lot of it; Most of the time just an id or something of that sort.
Medias
In this section, I present to you how fast code navigation might look like after mastering these shortcuts
Next/Previous word (selection & delete too)
Using overtype mode
In this post, I will assume you don't use Vim or any of these funky command line editor that have a 2 years and up learning curve.
Knowing the shortcuts to move around in your IDE and text editor is very important. Some common shortcuts that will help you work faster in Eclipse IDE but that should be available in most decent softwares
Software unique shortcuts
Duplicate line (Ctrl + Alt + Up/Down)
This is actually something unique to Eclipse, having the ability to duplicate a line not only down, but also up. It may not look like much at first but whenever I work out of Eclipse, I'm always bothered sometimes by the fact that I can't duplicate the line up rather than down.
Move line (Alt + Up/Down)
Extremely useful shortcut that helps moving lines around rather quickly.
Delete line (Ctrl + D)
How many times have you done this before; putting your cursor at the beginning of a line and then gently move it to the end, which is not only tedious but slow, to finally delete it? Incredible amount of time to be saved with this one.
OS wide shortcuts
Ctrl + Left/Right - Move between words. The shortcut I abuse the most out of everything here. The day I learned this I cried that night.
Ctrl + Backspace/Delete - Delete previous/next word. Second to most abused shortcut after the last.
Ctrl + Shift + Left/Right - Move between words but combined with the shift modifier, it will also select the text. Rather useful too.
Home/End - Go to the beginning/end of the light. This is the latest shortcut I've been trying to incorporate in my toolset. It can be useful at times!
Shift + Home/End - As with the other shortcut to move between words, this will select the text as the cursor moves to the end or beginning of the line. I actually use this shortcut more often with shift than without.
The overtype mode
One thing that is often overlooked is the overtype mode. You enable it by tapping the Ins. key on your keyboard. It makes it so that typing overwrites the text where the cursor is rather than inserting it. It's rather useful when you have to duplicate one line of code in particular where you don't have to change a whole lot of it; Most of the time just an id or something of that sort.
Medias
In this section, I present to you how fast code navigation might look like after mastering these shortcuts
Next/Previous word (selection & delete too)
Using overtype mode