473,394 Members | 1,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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!
Nov 9 '06 #1
2 1780
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

Nov 9 '06 #2
Thank you!

Python Rocks!

"Tim Chase" <py*********@tim.thechases.comwrote in message
news:ma***************************************@pyt hon.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



Nov 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
32
by: siggi | last post by:
@Ben Sizer Hi Ben, in January I received your message re Pygame and Python 2.5: As a Python (and programming ) newbie allow me a - certainly naive - question:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.