Vim indentation is aligned in vim mode, but it is chaotic in github.

  question, vim

This is in vim mode. vimrc, it seems that the comments are aligned.

After watching github, vimrc was a mess.

The same is true for opening with sublime, but it is normal again after Sublime sets tab size =2.

Because your file is indented with tab instead of space, just replace it:

sed -i '' -E "s/$(echo -n -e "\t")/  /g" .vimrc

In addition, vim can be configured to indent with space instead of tab:

set expandtab
 set tabstop=2
 set shiftwidth=2
 set softtabstop=2