vim-a simple and understandable Django code complement method __vim

Source: Internet
Author: User
Tags python script

both: Pydiction

Pydiction allows you to implement the TAB code complement in Vim, which includes: standard, custom, and Third-party modules and packages. Plus keywords, bifs, and strings. Pydiction mainly consists of three parts: python_pydiction.vim– This file for vim plugin file, implementation of the Python file TAB full function complete-dict– the file for vim DiC Tionary file, which contains information such as Python keywords and module structures. Is the reference file that plugin is looking for when it is complete pydiction.py– the file is a Python script file that is used to generate dictionary files. You can add more TAB-complete module pydiction configuration by executing this script to place the Python_pydiction.vim under the Ftplugin folder, such as mine:

/usr/share/vim/vimfiles/ftplugin/python_pydiction.vim
To generate a dictionary file
Python pydiction.py django.db.models
# For example, put pydiction.py in the settings.py folder to execute the above command, more at the end of this article
Edit VIMRC file, add three lines of code
FileType plugin on 
# Open plugin let
g:pydiction_location = '/path/to/your/complete-dict ' let
g:pydiction_menu_ Height =
# The dictionary file generated in the previous step:/data/www/xtyw/xtyw/complete-dict
# So the path above is it.
the use of Pydiction

tab auto complement, as shown in figure:

Finally, make up a dictionary of common Django needs to be imported:

Python pydiction.py Django django.conf django.contrib django.core django.db django.dispatch django.forms django.http Django.middleware django.shortuts django.template django.templatetags django.utils django.views

Finally: Markdown editor with good ah ~csdn I like you again

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.