Wikia

Vim Tips Wiki

Script:850

Talk0
1,612pages on
this wiki
Revision as of 14:25, August 10, 2012 by 41.133.24.109 (Talk)

Use this page to discuss script 850 Pydiction: Tab-complete your Python code

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Comments

This plugin works great, only problem is the TAB key does not do autocomplete (I have to use CTRL-X/O which works fine, except it's quite a few extra keystrokes). With TAB I get the error: -- Dictionary completion (^K^N^P) Pattern not found.

I also emptied out my .vimrc and left only:

filetype plugin on
let g:pydiction_location = '~/.vim.py'

Any ideas where I could check to see why TAB doesn't work as expected? thanks


Hi, I tried to use pydiction on my Unix system. According to its installation instructions, I just put all the files under ~/.vim/after/ftplugin/

and then tried to use the Tab completion in a Python script. But it did not work. Then I added 'filetype plugin on' into '~/.vimrc', still, it did not work. What can the problem be? Thanks!

The install instructions also include:

then make sure you set "g:pydiction_location" to the full path of where you installed complete-dict, i.e.:

       let g:pydiction_location = 'C:/vim/vimfiles/ftplugin/pydiction/complete-dict'

did you do this?
They also say,

You may install the other files (complete-dict and pydiction.py) anywhere you want. For this example, we'll assume you put them in C:\vim\vimfiles\ftplugin\pydiction\

Do not put any files but python_pydiction.vim in the ftplugin directory, only .vim files should go there.

Your statement above ("I just put all the files under ~/.vim/after/ftplugin/") indicates that you ignored this advice.
--Fritzophrenic 15:39, July 8, 2011 (UTC)

I find this tool is MUCH more useful when you sort the dictionary (alphabetically, then by number of "."'s) That way, your results come up in the order in which they are relevant (immediate children come first).

To do this:

cat complete-dict | sort -n |awk '$0=NF-1 $0OFS' FS=. complete-dict | sort | sed 's/.\(.*\)/\1/' > complete-dict2

mv complete-dict2 complete-dict

This sorts alphabetically->appends count of number of "."'s in the entry at the start of the line-> sorts by those numbers-> removes those added leading count numbers.


Had issues trying to get this to work. Using Linux, and create the ~/.vim/after/ftplugin/. Then moved the python_pydiction.vim file to that folder, but when I put the filetype plugin on in vim, it gave me some errors.

Error detected while processing /home/guest/.vimrc:
line   12:
E319: Sorry, the command is not available in this version: filetype plugin on
line   13:
E319: Sorry, the command is not available in this version: let g:pydiction_location='~/.vim/plugin/complete-dict'

I am confused if the let g:pydiction_location... was supposed to go under filetype. Regardless filetype also gives me a command not found here. --JZA 6:42, April 18, 2012 (UTC)

See :help E319. You are probably using a cut-down Vim that does not implement basic features. JohnBeckett 04:26, April 15, 2012 (UTC)

Around Wikia's network

Random Wiki