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.
LVL 1
naseeamAsked:
Who is Participating?
 
gelonidaCommented:
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

0
 
gelonidaCommented:
we need to see the example.

It might be an issue with the settings of
tabstop
softabstop
ident
0
 
naseeamAuthor Commented:
Attached is the attachment.
indent_increase__book_example.PNG
my_result.PNG
0
 
naseeamAuthor Commented:
I set indentation to 2 in .vimrc file.  Then, result was as expected.

Expert found root cause of the problem.  

Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.