VIM Settings for Python

VIM Settings for Python thumbnail
VIM configuration scripts can help automatically format Python source code files.

The Python programming language lets developers create functional tools very quickly, but they still have to sit down and write the source code. Python developers can use fully featured integrated development environments, or IDEs, that automatically perform certain actions to make it easier to write code or they can configure the text editor Vi Improved to perform similar functions.

  1. VIM

    • VIM is a standard text editor on many UNIX-based systems. Beginners tend to use a simpler editor when they are still learning the UNIX systems and its programs because VIM requires the user to learn keyboard commands in order to make full use of the program. These include basic functions, such as saving progress on the file, or advanced features, such as selecting entire lines or jumping to individual points in the text.

    Python and VIM

    • Programmers can use VIM to create and edit Python source files instead of a more complex IDE. VIM includes features that lend themselves to developing in Python, as well as other programming languages. These include highlighting matching parentheses, matching brackets and key control words such as "if" or "else." These features, however, are those that are useful to any programming languages and lack some mechanisms that would be useful specifically for Python.

    Helpful Python Features

    • Among the settings that Python programmers find useful to integrate into VIM are automatic indentation following certain key words. Python's syntax requires specific indentation patterns for the Python interpreter to correctly read source code. When the programmer's text editor automatically indents to the correct point it saves the programmer several keystrokes on every line of code. Programmers can also have personal preferences on further keywords for the editor to highlight, as well as marking syntax errors automatically.

    Configuring VIM

    • VIM allows its users to create customized commands to set the editor's behavior. These commands can be in the primary ".vimrc" file or additional files in the ".vim/syntax" folder in the user's home directory. Users can either download a Python configuration file that someone else wrote and place it in their ".vim/syntax" directory or write their own file using VIM's documentation.

Related Searches:

References

Resources

  • Photo Credit Comstock/Comstock/Getty Images

Comments

Related Ads

Featured