Vim Tips Wiki
Register
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
 
|previous=1545
 
|previous=1545
 
|next=1547
 
|next=1547
|created=2008
+
|created=February 7, 2008
 
|complexity=basic
 
|complexity=basic
 
|author=Legner
 
|author=Legner
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
You can use <code>gf</code> (goto file) in Python source code to open an imported Python file.
+
You can use <tt>gf</tt> (goto file) in Python source code to open an imported Python file.
   
 
Put the following in a script in:
 
Put the following in a script in:
*<code>~/.vim/after/ftplugin/python.vim</code> &nbsp;&nbsp; (on Unix systems)
+
*<tt>~/.vim/after/ftplugin/python.vim</tt> &nbsp;&nbsp; (on Unix systems)
*<code>$HOME/vimfiles/after/ftplugin/python.vim</code> &nbsp;&nbsp; (on Windows systems)
+
*<tt>$HOME/vimfiles/after/ftplugin/python.vim</tt> &nbsp;&nbsp; (on Windows systems)
   
 
<pre>
 
<pre>
Line 30: Line 30:
 
</pre>
 
</pre>
   
This allows you to use <code>gf</code> or Ctrl-W Ctrl-F to open the file under the cursor. It works pretty well. particularly for imports of the form:
+
This allows you to use <tt>gf</tt> or Ctrl-W Ctrl-F to open the file under the cursor. It works pretty well. particularly for imports of the form:
 
<pre>
 
<pre>
 
import abc.def.module
 
import abc.def.module
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)