vim-an easy-to-understand Django code completion method

Source: Internet
Author: User
Tags python script

Both: pydiction

Pydiction allows you to implement TAB code completion in Vim, including: Standard, Custom, and third-party modules and packages. Plus keywords, bifs, and strings.

The pydiction consists mainly of three parts:
    1. python_pydiction.vim– This file is Vim's plugin file, realizing the TAB completion function of Python file
    2. complete-dict– the file is a Vim dictionary file that contains information such as the Python keyword and the structure of the module. Is the reference file that plugin is looking for when you complete the completion
    3. pydiction.py– the file is a Python script file that is used to generate the dictionary file. Additional TAB completion modules can be added by executing the script
Configuration of the Pydiction
    • Put the Python_pydiction.vim under the Ftplugin folder, like mine:
/usr/share/vim/vimfiles/ftplugin/python_pydiction.vim
    • Generate a dictionary file
python pydiction.py django.db.models# 比如将pydiction.py放到settings.py的文件夹下执行上面的命令,更多的在本文最后
    • Edit the VIMRC file to add three lines of code
# 开启插件let‘/path/to/your/complete-dict‘let20# 上一步生成的字典文件:/data/www/xtyw/xtyw/complete-dict# 那么上面的path就是它了
Use of Pydiction

tab Auto-Complete,

Finally, fill in the usual Django dictionary that 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 Well, ~CSDN, I like you again.

vim-an easy-to-understand Django code completion method

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.