Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Navigating code efficiently (aka eliminate the mouse)

Custom Title Activated
Loyal Member
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)
oxysoft - Navigating code efficiently (aka eliminate the mouse) - RaGEZONE Forums


Using overtype mode
oxysoft - Navigating code efficiently (aka eliminate the mouse) - RaGEZONE Forums
 
Modeler / C++ Coder
Developer
Joined
Feb 6, 2008
Messages
561
Reaction score
483
You said its useful when you need to code with haste.. well in my perspective that is the worst thing you can do :)
coding takes accuracy and should never be rushed.. it only generates mistakes wich are otherwise easy not to make if you pay attention.. rushing code for me usually ends up taking more time then it saves in the end.. in the other hand.. yes these shortcuts are very useful and can help you work faster without losing precision. I use some of these shortcuts myself so here and there and yes they can save you some fiddling about that's for damn sure ;) good post for beginners!
 
Back
Top