search

Home  >  Q&A  >  body text

vimrc - vim indentation problem, it is all aligned in vim mode, but it is messed up in github

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

After looking at github, vimrc is a mess.

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

怪我咯怪我咯2806 days ago663

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-05-16 16:36:08

    Because your file uses tabs instead of spaces for indentation, just replace it:

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

    In addition, you can configure vim to use space instead of tab for indentation:

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

    reply
    0
  • Cancelreply