If you happen to end up being on a computer for long periods writing code, there are shortcuts to accomplish what you're already doing!! By using the mouse less and the keyboard more, you can actually lower the amount of time it takes to do what you're trying to do. In this post I'll address a few extremely useful keyboard shortcuts.....
NO.1: Ways to Move Stuff
Sometimes you need to move a line of code or sentence or whatever from one place to another...most obviously this can be done by selecting the text you want with a mouse/trackpad and copying it and moving it. But...
If you want to copy something you can use Ctrl+C and you'll capture the text you've highlighted or you can use Ctrl+X to cut the text. Ctrl+P will paste any copied(Ctrl+C) or cut(Ctrl+X) text to where your cursor currently is.
Moving text is another way to accomplish a similar thing. If you highlight text and want to move it to another line you can use Ctrl+arrowUP/arrowDown. This will move your highlighted text up and down as a whole and can be useful for repositioning.(may be app specific)
Also, sometimes you need to Tab lines in order to maintain correct spacing. Multiple lines that have been selected can be indented with Tab. If you want to "UnTab" you can select lines and press Shift+Tab and your lines will be "UnTabbed".!!
NO.2: Highlighting
Mouse highlighting is the most obvious way to make a text selection. Adding the shift key to selecting with the mouse can add chunks of text to what you are selecting. Try selecting a space and holding shift and then selecting another space...all intermediate text will be selected! This can be done more than once but only works in one direction, up or down.
Without using the mouse, if you want to select words, you can use Ctrl+left/right or up/down arrows to move between words/text divisions. If you combine Shift with Ctrl, text can be selected by word/text division!
Need to select everything on the window where you're currently working? Ctrl+A to the rescue!
NO.3 Saving and Dealing with Files
It's become ubiquitous for apps to use Ctrl+S to save your work. Use it often. Don't underestimate this simple and useful shortcut.
Often it is necessary to reload webpages you are working on..this can easily be accomplished with Ctrl+R(or Ctrl+Shift+R for cache refresh) in a browser.
If you are working between multiple windows/apps(which let's face it, you are), you can easily switch between them with Ctrl+Tab. This can be much faster than reaching for the mouse and navigating through a taskbar or desktop.
Have you ever been looking for a particular bit of text or name of a function/variable/etc and been annoyed at everything you had to search through? Use Ctrl+F! This will open a find search, which will search every file/page you open for the text you specify. Open all the files you want and open a Ctrl+F search and switch between your files...You will find what you're looking for!
Want to find an app? Press the Windows button and start typing the name of an app you want to use and you'll be pointed right to it....much faster than looking for icons to click on!!!
Speaking of searching....Ctrl+P will open a file search in VS Code or DevTools. This is similar to using the Windows button, but within the app you're currently using.
NO.4 Don't forget about..
Don't forget about the console! You can access the console view in most browsers by using Ctrl+shift+J(or Ctrl+shift+I for the element inspector). If you are a developer(which I'm assuming you are), you can access the console view and do a variety of things to get information about or manipulate the page you currently have loaded.
If you need to undo your last action, of course you can use Ctrl+Z. Conversely, if you want to redo an undone action, use Ctrl+Shift+Z.
Here's a recap of everything we've covered, for easy reference:
Ctrl+C/Ctrl+X - Copy/Cut
Ctrl+P - Paste
Ctrl+arrowUp/arrowDown - move highlighted text
Tab/Shift+Tab - Indent/"Unindent" text
Ctrl+arrowKey - move the cursor by text division(usually a space)
Ctrl+Shift+arrowKey -select text by division
Ctrl+A - Select all text
Ctrl+S - Save file
Ctrl+R/Ctrl+Shift+R - Reload page/Cache reload page
Ctrl+Tab - Switch between open windows
Ctrl+F - Find text on current page
Windows button - search computer(useful for starting apps)
Ctrl+P - File search
Ctrl+Shift+J - Open the console in a browser
Ctrl+Z/Ctrl+Shift+Z - Undo/Redo
That's all for now.!
The shortcuts presented here are not complicated or advanced but are extremely useful and should be integrated into your everyday workflow.
while (life.left.length > 0) {
life.do = coding();
}
Top comments (0)