Vim/Python Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Smith

    #1

    Vim/Python Help

    To all you vi/vim users out there.....

    I am just getting into python and am trying to learn how to use the
    python.vim script. I really like the fact that it autoindents for me while
    inserting defs etc, but how do I move my cursor to back to outer block (say
    at the end of a def) to continue with writing next def while still in insert
    mode? Right now I have to get out of insert mode to do this....very
    annoying!


  • Tim Chase

    #2
    Re: Vim/Python Help

    I am just getting into python and am trying to learn how to use the
    python.vim script. I really like the fact that it autoindents for me while
    inserting defs etc, but how do I move my cursor to back to outer block (say
    at the end of a def) to continue with writing next def while still in insert
    mode? Right now I have to get out of insert mode to do this....very
    annoying!
    If I understand what you're wanting, it sounds like you want an
    exdent sort of command.

    Vim provides two variants within insert mode:

    1) just plain control+D will exdent one 'shiftwidth'

    2) typing a zero followed by a control+D will exdent you to the
    far left margin

    You can read more in the help at

    :help i_CTRL-D
    :help i_0_CTRL-D
    :help i_^_CTRL-D

    (that last variant is more helpful for C/C++ coding than for
    Python, but it's nice to know it's there)

    For future reference regarding vim related questions, I highly
    recommend the vim mailing list, which you can find at www.vim.org
    which is almost pure content (very high S/N ratio) and gives the
    python ML a run for its money in terms of fast & accurate responses.

    -tkc





    Comment

    • Scott Smith

      #3
      Re: Vim/Python Help

      Thank you!

      Python Rocks!

      "Tim Chase" <python.list@ti m.thechases.com wrote in message
      news:mailman.19 87.1163096064.1 1739.python-list@python.org ...
      >I am just getting into python and am trying to learn how to use the
      >python.vim script. I really like the fact that it autoindents for me
      >while inserting defs etc, but how do I move my cursor to back to outer
      >block (say at the end of a def) to continue with writing next def while
      >still in insert mode? Right now I have to get out of insert mode to do
      >this....very annoying!
      >
      If I understand what you're wanting, it sounds like you want an exdent
      sort of command.
      >
      Vim provides two variants within insert mode:
      >
      1) just plain control+D will exdent one 'shiftwidth'
      >
      2) typing a zero followed by a control+D will exdent you to the far left
      margin
      >
      You can read more in the help at
      >
      :help i_CTRL-D
      :help i_0_CTRL-D
      :help i_^_CTRL-D
      >
      (that last variant is more helpful for C/C++ coding than for Python, but
      it's nice to know it's there)
      >
      For future reference regarding vim related questions, I highly recommend
      the vim mailing list, which you can find at www.vim.org which is almost
      pure content (very high S/N ratio) and gives the python ML a run for its
      money in terms of fast & accurate responses.
      >
      -tkc
      >
      >
      >
      >
      >

      Comment

      Working...