Vimprint

Vimprint

Vimprint (GitHub: nelstrom / vimprint) by Drew Neil is a Vim keystroke parser written with Ruby. Given suitable Vim commands as input, it can generate human-readable output.

The goal of the project is to allow Drew to produce real-time overlays of Vim commands. Plain English descriptions of commands, alongside the original input, would be extremely useful for teaching Vim on screencasts and workshops.

Read More →

Script Roundup: Vim Table Mode, Move Until Char Changes

Send in your Vim scripts for review through our contact form.

Vim Table Mode

Dhruva Sagar sent in Vim Table Mode (GitHub: dhruvasagar / vim-table-mode, License: MIT), a plugin for automatically creating and formatting tables. A recent update adds support for calculations, allowing tables to behave like spreadsheets.

There's a demonstration video on YouTube that covers the basic features.

Move Until Char Changes

I coincidentally found a spreadsheet-inspired script called move_until_char_changes.vim by Joey Twiddle, which mimics the Ctrl-Arrow shortcut in Excel. This allows you to move until there's a new character under the cursor. It has various options:

Read More →

24-bit Vim

If you've been following the recent Vim updates posted to vim_dev, then you may be interested in ZyX's work on supporting 24-bit colours in Vim:

There is ISO-8613-3 standard for 24-bit color in terminals: \e[38;2;{R};{G};{B}m (foreground, 48 for background) ({R},{G},{B} are decimal integers from 0 to 255). Currently it is fully supported only* by konsole and partially** in xterm. On Windows there is support for this in ConEmu. I am working on supporting this in vim (it will use guifg/guibg attributes in terminal). Working version, bookmark 24-bit-xterm. Does not work if you try to compile with gui support enabled.

This was posted to the Powerline issue list. Kim Silkebækken (Lokaltog) said he's already using Konsole and accepted the Powerline patch. ZyX also posted about using 24-bit colours in tmux:

Read More →

Floobits

Floobits

I seem to keep finding new solutions for collaborating in Vim. The latest is Floobits by Geoff Greer and Matt Kaniaris. It uses a server, on which you must create an account, and a Vim plugin that allows you to collaborate with other people. There is also a Sublime Text plugin -- by using a central server the authors have managed to make an editor agnostic solution.

Although the plugins are naturally open source, the server doesn't appear to be. It's free to use and you can sign in with GitHub, and there is API documentation should you wish to write other clients or plugins for the service.

Read More →

Script Roundup: vim-neatstatus

Send in your Vim scripts for review through our contact form.

vim-neatstatus

Powerline is a popular solution for pimping out Vim and tmux, but sometimes you just want something simple you can easily hack. vim-neatstatus (GitHub: maciakl / vim-neatstatus) by Lukasz Grzegorz Maciak is just the thing -- it has a clear, colour changing mode indicator, and various bits of metadata about the current file.

To hook into mode changes, neatstatus adds autocommands to InsertEnter, InsertChange, and InsertLeave. It then sets the statusline by setting stl. Everything is broken into functions so it's easy to see how it works. In fact, if you want to customise your statusline without relying on something like Powerline, then you could use this as a template -- I did something similar for my tmux settings.

Read More →

Terning Tricks

Tern for Vim

Next week I'll be speaking about Tern at Vim London. Tern is a server that allows text editors to intelligently autocomplete JavaScript, rename variables, and display documentation. It includes support for Node, jQuery, and standard JavaScript/ECMAScript.

During the preparation of my slides I realised there are a few things about Tern for Vim that aren't entirely obvious, mainly to do with configuration options. For one thing, the Vim plugin has excellent keyboard shortcuts that aren't enabled by default. To enable them, add this to your .vimrc:

Read More →

Vim 7.3.999 and Beyond

It turns out Vim did reach version 7.3.999, and then 7.3.1000 and beyond:

  • 7.3.999 - New regexp engine sets curbuf temporarily, use reg_buf instead, like the old engine
  • 7.3.1000 - Typo in char value causes out of bounds access, fix character value
  • 7.3.1001 - Duplicate condition in if, remove one condition
  • 7.3.1002 - Valgrind errors for Python interface, fix memory leaks when running tests
  • 7.3.1003 - Python interface does not compile with Python 2.2
  • 7.3.1004 - No error when option could not be set, report an error

These patches pertain to the promised regular expression and Python interface improvements, so work is definitely culminating towards 7.4. The Vim Announce list will be updated when the next release is ready, although it can be interesting to follow the incremental patches on the vim_dev list.

Read More →

Script Roundup: vim-bgimg, CoVim

Send in your Vim scripts for review through our contact form.

vim-bgimg

vim-bgimg (GitHub: ynkdir / vim-bgimg) by Yukihiro Nakadaira makes your dreams come true... if your dreams are to give gVim its own wallpaper. It only works on Windows (it uses Gdi32.dll), but if you like this you might also like the same author's vim-paint.

CoVim

CoVim (GitHub: FredKSchott / CoVim) by Fred K. Schott is a collaborative editing plugin for Vim. It requires Python 2.5+, Python support in Vim, and the Twisted library.

Once it's installed, a server must be started with :CoVim start. Clients can then connect by using :CoVim connect.

Read More →

ZZ

I was at a VimGolf evening at Vim London a few months ago, and one thing I picked up there was the use of ZZ. If you look at VimGolf solutions, a lot use ZZ to write and close the file. If multiple windows (split buffers) are open, it'll write and close that window. If you're in Normal mode, this is shorter than typing :wq.

There's also ZQ, which quits without saving changes. ZQ is equivalent to :q! rather than :qa!, which quits all windows and Vim entirely.

I like these marginally more efficient ways to quit Vim -- I use ZZ more than :wq or CTRL-W c (which just closes a window). Vim's documentation covers all of these commands and more under Writing and quitting (:help write-quit).

Read More →