Vim Tips Wiki
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 19: Line 19:
 
</pre>
 
</pre>
   
will set the <code>'errorformat'</code> option for PyUnit, enabling Vim to parse a <code>unittest</code> test runner's output and to enter quickfix mode.
+
will set the <tt>'errorformat'</tt> option for PyUnit, enabling Vim to parse a <tt>unittest</tt> test runner's output and to enter quickfix mode.
   
To run all your unit tests at once, using Vim's <code>:make</code> command, you'll need to set the <code>'makeprg'</code> option and provide a test runner. This is often done using an <code>alltests.py</code> script.
+
To run all your unit tests at once, using Vim's <tt>:make</tt> command, you'll need to set the <tt>'makeprg'</tt> option and provide a test runner. This is often done using an <tt>alltests.py</tt> script.
 
<pre>
 
<pre>
 
:setlocal makeprg=./alltests.py
 
:setlocal makeprg=./alltests.py
 
</pre>
 
</pre>
   
Here is an example <code>alltests.py</code>:
+
Here is an example <tt>alltests.py</tt>:
 
<pre>
 
<pre>
 
#!/usr/bin/env python2
 
#!/usr/bin/env python2
Line 49: Line 49:
 
</pre>
 
</pre>
   
Here is an alternative <code>alltests.py</code>:
+
Here is an alternative <tt>alltests.py</tt>:
 
<pre>
 
<pre>
 
#!/usr/bin/env python
 
#!/usr/bin/env python
Line 104: Line 104:
 
</pre>
 
</pre>
   
To have Vim automatically use these settings for all Python files, add the following to <code>~/.vim/after/ftplugin/python.vim</code> (<code>$HOME\vimfiles\after\ftplugin\python.vim</code> on Windows)
+
To have Vim automatically use these settings for all Python files, add the following to <tt>~/.vim/after/ftplugin/python.vim</tt> (<tt>$HOME\vimfiles\after\ftplugin\python.vim</tt> on Windows)
   
 
<pre>
 
<pre>
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)