Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Working with Linux ??? Quick Hacks for the Command Line

You're reading from   Working with Linux ??? Quick Hacks for the Command Line Command line power like you've never seen

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129184
Length 222 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Bogdan Vaida Bogdan Vaida
Author Profile Icon Bogdan Vaida
Bogdan Vaida
Petru I»ôfan Petru I»ôfan
Author Profile Icon Petru I»ôfan
Petru I»ôfan
Arrow right icon
View More author details
Toc

Keyboard kung fu

Now that we have Vim all set up, it's time to learn some more command line shortcuts. The first thing we will be looking at is indentation.

Indentation can be done in Vim by going into visual mode and typing V for selecting portions of text or V for selecting full lines, followed by > or < to indent right or left. Afterwards press . to repeat the last operation:

Keyboard kung fu

Any operation can be undone by hitting u and can then be redone by hitting Ctrl + R (as in undo and redo). This is the equivalent of Ctrl + Z and Ctrl + Shift + Z in most popular editors.

When in visual mode, we have the option of changing the case of letters by hitting U to make all text upper case, u for lower case and ~ to reverse current case:

Keyboard kung fu

Other handy shortcuts are:

  • G: Go to end of file
  • gg: Go to start of file
  • Select all: This is not really a shortcut, but a combination of commands: gg V G, as in go to start of file, select full line, and move to the end.

Vim also has a handy shortcut for opening man...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image