Archive for the ‘Vim’ Category

h1

Improving Vim’s Mac integration

July 17, 2007

Update: our first patch is now available!

Vim is a great editor and OS X a lovely operating system, but unfortunately, they do not go really well together.  No wonder requests for better OS X integration are at the top of the requested features list.

But so far the Mac Vim community doesn’t seem to have the manpower to get cranking on these issues. Luckily there’s Jjgod Jiang working on a Summer Of Code project to build a Cocoa GUI for vim.

As avid Vim users we’d like to contribute something as well. So we took the week off and started hacking (with just a grain of C knowlegde and no prior Mac API experience) Vim to implement the ODB Editor Suite which will make it possible to use Vim from a whole bunch of FTP applications. We’re making progress and hope to ‘release’ a first version patch soon.

If time allows we’ll also try to develop a simple ‘Edit in Vim’ button that can be used from text widgets in any application.

Advertisements
h1

V: find and edit files quickly via your commandline

April 23, 2007

I’m working on a project with a lot of files. Most of the time, I know exactly which file I want to edit. However, because everything is nicely organized in directories and packages, it’s very tedious to keep typing a long file-path.

I created a small tool which recursively searches for the (partial) filename you provide in the current directory. If it finds only one match, it will launch vim for that file. If it finds more matches, it will show you a list of files to choose from. It will remember your choice, and assign a weight to that file, so that it will bubble to the top of the list next time.

Currently the weight is assigned to the relative filepath. This means that you can easily switch to another branch of your project if it has the same structure. It also means that you always have to run the program from the root of your project.

As a small bonus I added a feature where you can specify the command to run. By default it is vim, but if you provide a different command as the second argument, it will launch that command. For example, you can run it as “v myfile less”, which will open the selected file in less instead of vim.

I hope you enjoy it, let me know if you do. Here’s the link: v.rb. Save the file somewhere in your path.