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.


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

    • 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

  2. Great job.
    For the git fetch just issue the following:
    git submodule add 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.

  3. great job. awesome.

  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.’

    • Sounds like you aren’t maintaining your .vim directory as a git repository. You should simply do a ‘git clone bundle/vim-table-mode’ within your .vim directory and you should be good to go.

      • 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.

        • 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.

  5. very interesting lugin !
    But i have a problem, I install with vundle and I can not get it to work.
    I don’t know where I fail (tabular is already installed)

    • Do you see an error ? Tabular is not a dependency anymore, kindly install it and when you wish to use it enable it by calling :TableModeEnable

      • I reinstall it and it work, I don’t know what I did before 😀
        Just one problem with the “+—-+—-+” lines, it doesn’t work
        I can have |—–+—–+—-| if I put “|-” at the beginning but it’s not like in the video

        for example:
        | This | is | a | test |
        | Interesting | plugin |
        | Vim | Table | Mode |

        (there is no shift in the file when i do it)

        • Use ‘||’ to add a border, it will automatically create with correct formatting and update it automatically when the table changes. If you want to change how the border looks, please see :h table-mode

  6. Great Work !!! This is one awesome plugin.

    Is there a way to make multi line cells ?

    • No, since it’s all text based having cells spanning multiple rows / columns will add extra overhead for evaluating formulas.

  7. My .vimrc is not on GitHub so I tried to install this way but received error:

    Please make sure you have the correct access rights
    and the repository exists.
    11:37 ~/.vim $ sudo git clone bundle/vim-table-mode
    Cloning into ‘bundle/vim-table-mode’…
    Warning: Permanently added the RSA host key for IP address ‘’ to the list of known hosts.
    Permission denied (publickey).
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    Any ideas?

    Thanks, Dave

  8. Hi again, I have table-mode up and running, but I am not successful with formulas. Example :
    | part number | Description | price | Qty | cost | — cost being a calculated cell . I haven’t been able to
    figure out how to make it work ? May I have a little help on this ?

  9. Hi, well I am not too sure what you’re facing a problem with. However I would encourage you to open an issue with a bit more details so I could help you more. You can open an issue here :

Leave a Reply

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