Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Basic PHP Website (2018) Adding a Basic Form Using A Third-Party Library

Duplicating lines shortcut

Is there a shortcut for duplicating lines. I noticed that the instructor copy and pasted the require 'vendor/phpmailer/src/PHPMailer.php'; instantly.

2 Answers

Thanks, yea I found that it is command + S. Yeah I kind of like the vi editor if you type Y Y P for duplicating a line and dd for removing one.

Genevieve Herres
PLUS
Genevieve Herres
Courses Plus Student 3,457 Points

It depends on your text editor. Certain text editors have keyboard shortcuts for a variety of commands, however, it can take a while to really master them.

For example, I once saw a very good coder working with the vi text editor and it looked practically like magic how code was moving around. However, it wasn't magic, it was decades of programming with that editor.

If you are using a mac, there are some built-in keyboard shortcuts very similar to the emacs text editor which can really save time, you can see a summary of them here: https://jblevins.org/log/kbd