vim python: substitute 'spaces' indent to 'tabs'?

Discussion in 'Python' started by Rocky Zhou, Apr 2, 2007.

  1. Rocky Zhou

    Rocky Zhou Guest

    I am accustomed to vi my pthon scripts with 'tab' indent. But when I
    copy some code to my script, the indent may be 'spaces'. So I wanna a
    way to substitute those 'spaces' to be 'tabs' conveniently.

    For example, I:
    expand -t4 >/tmp/
    vi /tmp/

    Then in vim, the indents should be:
    /^\( \{4\}\)*/
    but I don't know how to substitute this to that:

    Is there any way?

    Rocky Zhou, Apr 2, 2007
    1. Advertisements

  2. Rocky Zhou

    forgems Guest

    :set noet
    forgems, Apr 2, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.