vim tab space

  1. Your current setting(tab == 6-spaces-width && expand tab)

    1
    2
    3
    4
    5
    :set ts=6 et

    #!/usr/bin/env python
    def fun():
    ······print "hello, world"
  2. convet 6-spaces to tab

    1
    2
    3
    4
    5
    6
    7
    :set noet
    :ret!


    #!/usr/bin/env python
    def fun():
    »·····print "hello, world"
  3. reset tab to 4-space-width

    1
    2
    3
    4
    5
    :set ts=4

    #!/usr/bin/env python
    def fun():
    »···print "hello, world"
  4. convet tab to 4 spaces

    1
    2
    3
    4
    5
    6
    :set et
    :ret!

    #!/usr/bin/env python
    def fun():
    ····print "hello, world"
请作者喝一杯咖啡☕️