<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vim on Random notes from mg</title>
    <link>https://mg.pov.lt/blog/tags/vim.html</link>
    <description>Recent content in Vim on Random notes from mg</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>marius@gedmin.as (Marius Gedminas)</managingEditor>
    <webMaster>marius@gedmin.as (Marius Gedminas)</webMaster>
    <copyright>Copyright © 2004–2020 Marius Gedminas</copyright>
    <lastBuildDate>Wed, 09 Dec 2009 01:23:53 +0200</lastBuildDate>
    <atom:link href="https://mg.pov.lt/blog/tags/vim/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Unix is an IDE, or my Vim plugins</title>
      <link>https://mg.pov.lt/blog/unix-is-an-ide.html</link>
      <pubDate>Wed, 09 Dec 2009 01:23:53 +0200</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/unix-is-an-ide.html</guid>
      <description>
&lt;p&gt;&lt;a href=&#34;http://c2.com/cgi/wiki?UnixIsAnIde&#34;&gt;Unix is an IDE&lt;/a&gt;.  I do my
development (Python web apps mostly) with &lt;a href=&#34;http://www.vim.org/&#34;&gt;Vim&lt;/a&gt;
with a &lt;a href=&#34;https://mg.pov.lt/vim/&#34;&gt;bunch of custom plugins&lt;/a&gt;, shell
(in GNOME Terminal: tabs rule!), GNU make, ctags, find + grep,
svn/bzr/hg/git.&lt;/p&gt;

&lt;p&gt;The current working directory is my project configuration/state.  I run
tests here (bin/test), I search for code here (vim -t TagName, find + grep), I
run applications here (make run or bin/&lt;em&gt;appname&lt;/em&gt;).  I can multitask
freely, for example, if I&#39;m in the middle of typing an SVN commit message, I
can hit Ctrl+Shift+T, get a new terminal tab in the same working directory, and
look something up.  No aliases/environment variables/symlinks&lt;!--
/&lt;a
  href=&#34;http://blog.doughellmann.com/2009/12/switching-development-contexts-with.html&#34;&gt;scripts
making changes to config files&lt;/a&gt;
(I&#39;ve no idea why I assumed those; I must&#39;ve misread something in Doug&#39;s post)
--&gt;.  I can work on multiple projects at the
same time.  I can work remotely (over ssh).&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://vimeo.com/user1043515&#34;&gt;Gary Bernhardt&#39;s screencasts on
  Vimeo&lt;/a&gt; show how productive you can get if you learn Vim and tailor it
to your needs.  I have Vim scripts that let me&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    See the name of the class and function that I&#39;m editing in the statusbar,
    even if the class/function definition is offscreen:
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/pythonhelper.vim&#34;&gt;pythonhelper.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    See all pyflakes warnings and errors in a list as soon as I press F2 to
    save the file: &lt;a
      href=&#34;https://mg.pov.lt/vim/plugin/python_check_syntax.vim&#34;&gt;python_check_syntax.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Add a &#34;from foo.bar import Something&#34; line at the top of the file if I
    press F5 when my cursor is on Something, looking up the package and module
    from ctags: &lt;a
      href=&#34;https://mg.pov.lt/vim/plugin/python-imports.vim&#34;&gt;python-imports.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Switch between production code and unit tests with a single key if the
    project uses one of several conventions for tests (e.g. ./foo.py
    &lt;tt&gt;&amp;lt;-&amp;gt;&lt;/tt&gt; ./tests/test_foo.py):
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/py-test-switcher.vim&#34;&gt;py-test-switcher.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Generate a command line for running one particular unit test (the one
    my cursor is inside) and copy it into the system clipboard, so I can
    run that test by Alt-Tabbing into my terminal window and pasting.
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/py-test-runner.vim&#34;&gt;py-test-runner.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Open the right file and move the cursor to the right line if I
    triple-click a line of traceback in a shell (or an email) then press F7 in
    my gvim window:
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/py-test-locator.vim&#34;&gt;py-test-locator.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Compare my version of the code with the pristine version in source control
    in an interactive side-by-side diff that lets me revert bits I no longer
    want:
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/vcscommand.vim&#34;&gt;vcscommand.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Highlight which lines of the source are covered by my tests, if I have
    coverage information in trace.py format:
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/py-coverage-highlight.vim&#34;&gt;py-coverage-highlight.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Show the signature of a function/class&#39;s __init__ when I type the name
    of that class/function and an open parenthesis (looked up from tags):
    &lt;a href=&#34;https://mg.pov.lt/vim/plugin/py-function-signature.vim&#34;&gt;py-function-signature.vim&lt;/a&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Fold code into an outline so I only see names of methods or classes
    instead of their full bodies:
    &lt;a href=&#34;https://mg.pov.lt/vim/vimrc&#34;&gt;vimrc&lt;/a&gt;, function PythonFoldLevel.
  &lt;/li&gt;
  &lt;li&gt;
    Fold diff files so I can see whole hunks/files and can delete those with
    a single key (well, two keys -- dd).  Useful for reviewing &lt;em&gt;large&lt;/em&gt;
    diffs (tens of thousands of lines):
    &lt;a href=&#34;https://mg.pov.lt/vim/vimrc&#34;&gt;vimrc&lt;/a&gt;, function DiffFoldLevel.
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of these come from &lt;a href=&#34;http://www.vim.org&#34;&gt;www.vim.org&lt;/a&gt;, some
I&#39;ve written myself, some I&#39;ve taken and modified a little bit to avoid an
irritating quirk or add a missing feature.  Some things I don&#39;t have (and envy
Emacs or IDE users for having -- like an integrated debugger for Python apps,
and, generally, integration with other tools, running in the background).&lt;/p&gt;

&lt;p&gt;It&#39;s been my plan for a long time to polish my plugins, release them
somewhere (github?  bitbucket? launchpad?) and upload to vim.org, but as it
doesn&#39;t seem to be happening, I thought I&#39;d at least put an &lt;a
  href=&#34;https://mg.pov.lt/vim&#34;&gt;svn
  export of my ~/.vim&lt;/a&gt; on the web.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
