VIM Table Mode

UPDATE 2: Released v 2.0 of the plugin. Check github for details.

UPDATE : I have added more features to the original plugin, showcasing some core features in a new demo (Part 2).

Recently a friend of mine showed off emacs table mode to me and to be honest I felt a bit jealous :). Hence I began to search for existing vim plugins that might offer a similar functionality and I did find a plugin vim rst tables, which is a ftplugin that aids the creation of tables within rst files and allows you to format existing content into a table, although this plugin came closest to what I was looking for it wasn’t quite there. Then I found a very interesting & simple plugin shared as a gist by the infamous Tim Popecucumbertables.vim which I found quite impressive.

I began experimenting with this in an attempt to make it a bit more comprehensive and to allow for better formatted tables creation and after hacking on it for a couple of nights I came up with the table-mode vim plugin.

You can see it in action here :

  • Part 2:
  • Part 1:

All you have to do is start on a new line (indentation is ignored), enable Table Mode by either calling the command :TableModeEnable, or :TableModeToggle or you can also use the default mapping <Leader>tm which can be changed easily or alternative you can also enable table mode permanently by setting let g:table_mode_always_active = 1 in your vimrc (not recommended).

I believe I have successfully been able to create a truly awesome table mode plugin that enables one to create very neat looking tables that align automatically on the fly as you type and at the same time is highly customisable. Please go through the vim helpdocs with :h table-mode.txt for details on how to customize it.

Please do use it and report any bugs if you find and give your feedback.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

19 Trackbacks