Why >G keyboard sequence indents line Eight spaces when book show ident as Two spaces ?

My computer is running Windows 10 Pro 64-bit.  I connect to remote Linux Machine using telnet utility.   My shell is bash.

I invoked Vim version 8.0.

I'm following a example from book, Practical Vim Second Edition.

The book asks to press certain keyboard sequence to indent Two spaces but the line is indented Eight spaces.  Please see attached.

I don't have vimrc file.  Whether I run default vimrc or not, I get the same result.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

we need to see the example.

It might be an issue with the settings of
naseeamAuthor Commented:
Attached is the attachment.
It could  be, that your vim is configured for autodetecting the filetype and some settings depending on the file name.
so if the example used for example the file name test.js and your file name was for example test.py it can be, that the indentation is not
identical for both cases.

You can set the shift width to a fixed value independently of the file type by creating a .vimrc file in your home directory and adding the following line
set shiftwidth=2

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
naseeamAuthor Commented:
I set indentation to 2 in .vimrc file.  Then, result was as expected.

Expert found root cause of the problem.  

Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.