Vim Tips Wiki
(Format comment and reply.)
Line 42: Line 42:
 
----
 
----
 
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.
 
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.
  +
<pre>
 
 
Error detected while processing /home/guest/.vimrc:
 
Error detected while processing /home/guest/.vimrc:
 
line 12:
 
line 12:
Line 48: Line 48:
 
line 13:
 
line 13:
 
E319: Sorry, the command is not available in this version: let g:pydiction_location='~/.vim/plugin/complete-dict'
 
E319: Sorry, the command is not available in this version: let g:pydiction_location='~/.vim/plugin/complete-dict'
  +
</pre>
   
I am confused if the let g:pydiction_location... was supposed to go under filetype.
+
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. --[[User:JZA|JZA]] 6:42, April 18, 2012 (UTC)
  +
:See {{help|E319}}. You are probably using a cut-down Vim that does not implement basic features. [[User:JohnBeckett|JohnBeckett]] 04:26, April 15, 2012 (UTC)
 
Regardless filetype also gives me a command not found here.
 
 
:--[[User:JZA|JZA]] 6:42, April 18, 2012 (UTC)
 

Revision as of 04:26, 15 April 2012

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

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)