2015-01-21

The new vimgolf client

A new vimgolf client, version 0.4.8, was just released. It has lots of improvements. I added them, and I want to boast about it.

Showing your keystrokes

When you exit Vim, whether your solution worked or not, the new client prints your keystrokes. That should be useful for lots of players, though seeing your keystrokes isn't that special if you use a workflow like mine. It's still useful though:

  • If you're wondering if you typed something wrong, you don't have to guess.
  • If you want to paste an alternate solution in a comment (or a message board or whatever), you can copy it straight from the vimgolf client. It will verify that your solution actually works, and ensure you don't have typos.

Local mode

You can now use the vimgolf client to play with local files. Run:

vimgolf local file1 file2

to play with file1 as input and file2 as output.

  • You'll edit a copy of file1, so your original files will be untouched.
  • You'll see your stroke count and pretty-printed keystrokes after each try. (See above.)
  • You play in a standard environment, independent of your usual Vim configuration. This is useful for answering questions on message boards or play-testing challenges you want to post to vimgolf.com.

You don't need Twitter just to play

In the past, you needed to set up a Twitter account and connect it to vimgolf.com just to download and play a challenge. This has been fixed. If your account hasn't been set up, you'll now be able to do everything except upload your solution to vimgolf.com. You'll get a setup option instead, which you're free to ignore.

No more <fd-/<ff- strokes

vimgolf.com had a long-standing bug of mishandling certain keystrokes, like showing <C-@> as <ff-58>. Since this was a bug in the client as well, it's now fixed. You should never see these again.

Security fix

One great feature of the new client is not letting attackers run shell commands on your computer. When you download a challenge from vimgolf.com, it gives you a file extension, so Vim can use filetype-specific highlighting/indent. In the past, this string was inserted, unsanitized, into the command that executes vim, which was run by the shell. That's a terrible idea. The new version disinfects the file extension, and doesn't use the shell to run external programs.

The old version also got its vimrc from the server every time you downloaded a challenge. An attacker who modified that vimrc in transit could do a lot of damage. The new version includes the vimrc in the gem.

Easier to use gvim

You've always been able to use the GOLFVIM environment variable to select the vim command you want to use. Previously, you had to use something like GOLFVIM="gvim --nofork -U NONE" to make gvim work right. Now you can just GOLFVIM=gvim.

Also, gvim users would previously be charged a stroke every time the editor gained or lost focus. This was the same bug that caused the <fd- strokes, and is now fixed.

Thoughts

We're never going to reach version 1.0.

1 comment:

  1. I love that it shows your keystrokes now. Thanks! I've been saving them in a separate file as I go along and figure things out. This makes it much easier.

    ReplyDelete