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.

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
VIM Table Mode, 5.0 out of 5 based on 1 rating

9 Comments

 Add your comment
  1. git submodule add git@github.com:dhruvasagar/vim-table-mode.git bundle/table-mode
    but got:
    fatal: Not a git repository (or any of the parent directories): .git

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Hi this is applicable if your .vim directory is kept as a git repository and you are installing plugins as submodules.

      If you aren’t using git & submodules, you should clone the files and then mv / cp the plugin/table-mode.vim to ~/.vim/plugin/table-mode.vim

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  2. Great job.
    For the git fetch just issue the following:
    git submodule add https://github.com/dhruvasagar/vim-table-mode.git bundle/table-mode

    There is a minor typo, I guess you mean h: table-mode.txt (and not h: text-mode.txt).

    Thanks for sharing.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. great job. awesome.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. I have been trying to download and install this great plugin on windows 8 and linux mint 15. When attempting to download using the git submodual, – I am using Pathogen – I receive the following message ‘ You need to run this command from the toplevel of the working tree.’

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Sounds like you aren’t maintaining your .vim directory as a git repository. You should simply do a ‘git clone git@github.com:dhruvasagar/vim-table-mode.git bundle/vim-table-mode’ within your .vim directory and you should be good to go.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Sorry to bother you again, I have table mode downloaded and installed. I am having no luck at all in using it. I really don’t know what to do with this point, outside of deleting everything and starting over. Not sure if that would even help. I was sort of hoping that you could give me some insight on what I have to do to get this program working.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • I am not sure what’ problem you are facing. Kindly refer to the installation instructions mentioned in the README at github. Or open an issue there in github with a few details and I could help you further there.

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)

Leave a Reply