How to use tab for python code completion in vim
Pydiction allows you to implement TAB code completion in Vim. The content that can be completed includes: standard, custom, and third-party modules and packages. Plus keywords, BIFs, and strings.
Pydiction consists of 3 main files:
python_pydiction.vim -- This file is Vim's plugin file, which implements the TAB completion function of Python files.
complete-dict -- This file is Vim's dictionary file, which contains information such as Python keywords and module structure. Is the reference file that the plugin looks for when completing.
pydiction.py -- (Optional) This file is a Python script file used to generate dictionary files. More TAB-completable modules can be added by executing this script.
Usage
======
Enter part of the Python keyword, module name, attribute or method name in Vim, and then press the Tab key to pop up the completion information.
For example, enter
os.p
will pop up
os.pardir
os.path
os.pathconf(
os.pathconf_names
os.pathsep
os.pipe(
. ..
If you find that the results you get in the TAB completion menu are not what you want, one possible reason is that you have not set Vim to ignore case. You can set it through ":set noic".
【How to install】
Under UNIX/LINUX, put python_pydiction.vim into ~/.vim/after/ftplugin/. If the directory does not exist, create it manually. Vim will automatically search for relevant files in this directory. Do not put other files except python_pydiction.vim into this directory.
Add the following field to your vimrc file to enable ftplugins:
filetype plugin on
Then make sure to set "g:pydiction_location" to point to where you placed it The full path of the complete-dict file, for example
let g:pydiction_location = 'C:/vim/vimfiles/ftplugin/pydiction/complete-dict'
You can refer to
# unzip pydiction-1.2.zip
# cp python_pydiction.vim /usr/share/vim/vim70/ftplugin
# mkdir /usr/share/vim/vim70/pydiction
# cp complete-dict pydiction.py /usr/share/vim/vim70/pydiction/
# vi ~/.vimrc
...
# Add
let g:pydiction_location = '/usr/share/vim/vim70/pydiction/complete-dict'
let g:pydiction_menu_height = 20
Open the python script file and press the TAB key to activate the auto-complete menu

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

When using Python's pandas library, how to copy whole columns between two DataFrames with different structures is a common problem. Suppose we have two Dats...

How to teach computer novice programming basics within 10 hours? If you only have 10 hours to teach computer novice some programming knowledge, what would you choose to teach...

How to avoid being detected when using FiddlerEverywhere for man-in-the-middle readings When you use FiddlerEverywhere...

How does Uvicorn continuously listen for HTTP requests? Uvicorn is a lightweight web server based on ASGI. One of its core functions is to listen for HTTP requests and proceed...

The article discusses popular Python libraries like NumPy, Pandas, Matplotlib, Scikit-learn, TensorFlow, Django, Flask, and Requests, detailing their uses in scientific computing, data analysis, visualization, machine learning, web development, and H

In Python, how to dynamically create an object through a string and call its methods? This is a common programming requirement, especially if it needs to be configured or run...

Using python in Linux terminal...
