Articles Tagged: vim

Stealing from Padre for Vim part 3 July 03, 2009

As promised in my last post I have released a new version of App::EditorTools and have a number of screenshots of the new functionality. This version includes App::EditorTools::Vim, which provides an easy way to add the vim scripts to integrate the package into Vim.

perl -MApp::EditorTools::Vim -e run > ~/.vim/ftplugin/perl/editortools.vim

And now you should have the following mappings:

  • ,pp - Show a menu of the functions available from App::EditorTools
  • ,pL - Lexically rename the variable under the cursor (make sure the cursor is at the start of the variable for now
  • ,pP - Rename the package based on the path of the current buffer
  • ,pI - Introduce a temporary variable

Here are a few screenshots of these actions:


More theft from Padre June 27, 2009

I was pleasantly surprise at the positive response to my last post on Stealing from Padre for Vim—particularly from the Padre developers! Seems they had hoped/planned on separating some of the tools out of the Padre core from the beginning (and many seem to be vimmers).

With their blessing and encouragement, I have pulled the editor independent parts of their PPI::Task tools into its own distribution—PPIx::EditorTools—available now on CPAN. I also adapted the current version of Padre to work wit the external package and released App::EditorTools to provide a command line interface for those editors that need it (i.e., vim). I’ll post another screencast and the Vim scripts needed to integrate it shortly.


Stealing from Padre for Vim June 16, 2009

I’m sure the Padre developers weren’t hoping to have their code absconded for those of us addicted to vim, but tsee’s recent blog post on refactoring with Padre’s lexical variable replace made me jealous—I want that for vim! So hack, hack, hack and voila:



Recovering After Vim Terminates May 19, 2009

When vim is shutdowns abnormally it leaves a bunch of .swp files around.1 Given the way I program (very iterative and test focused) those backups are rarely more current than the saved file. A great time saver to help with recovery is the vim DiffOrig command. After learning about it on StackOverflow, I put together the following bash script to find any swap files under the current directory, open each in vim, run DiffOrig and prompt to delete after you close vim.



The contents of this blog are licensed under the Creative Commons “Attribution-Noncommercial-Share Alike 3.0″ license.