vim-table-mode
                                
                                 vim-table-mode copied to clipboard
                                
                                    vim-table-mode copied to clipboard
                            
                            
                            
                        Very slow for a table with many rows
I try to use a table as a "table of content" in a markdown file. It has more than 1000 lines. However, it gets quite slow, especially when the width of a column needs to be adjusted or a new column is inserted. Is there a way to boost its performance? Thank you.
@yanzhang0219 Thanks for letting me know, would have to investigate, likely needs some optimisations. I have personally never dealt with such long tables.
Thank you very much. BTW, copying one row followed by pasting many times say 1000 is quite slow as well. When pasting, I can observe the pasting process, i.e., rows are added one by one, and they are not finished immediately.
Thanks.
That's likely vim itself, instead of pasting using some combination of Cmd +v or Ctrl + Shift + v if you just used p, or 1000p it shouldn't be as slow. @yanzhang0219
Oh sorry. The pasting is fine. I remember incorrectly.
The issue I described above is related the insert column as well. If I have a table with 1000 row, then if I insert a column, after pressing <Leader>tic, I can observe the inserting process, i.e., rows are scanned one by one and I can see the table is scrolling till the end, instead of finishing immediately.
I attached a short video below as a demo.
https://user-images.githubusercontent.com/11582667/112211047-ad341300-8bd8-11eb-91a4-a8ebee603b09.mov
What's more, with a 1000 row table, the cursor jumping is sluggish as well like gg or G.
Thank you.
@yanzhang0219 i'll investigate, although we're likely dealing with extremes here. There still should be scope for improvement, but is going to be limited by what vim itself can do. Things like sluggish on gg or G indicate it's vim that's slowing down because vim-table-mode doesn't do anything with regular movement. Certain filetypes syntax definitions can sometimes cause slowness. If it's not the syntax of the filetype itself, you may also try disabling vim-table-mode's table syntax, that could be the culprit too.
Sure. I will try that. Thank you.
I'm experiencing sluggish performance with a table of only 40ish rows... Tried disabling the table syntax, but there is still definite slow-downs, for example when hitting 
@kflak Thanks for letting me know, I haven't tested much on such large tables. I will take a look, I am sure there are performance improvements that can be done.
As a work around, I can recommend disable auto align feature and rely on manually aligning the table with :TableModeRealign instead, that way it should be easier to deal with large tables.
Will see if I can give it a try later tonight! So far it seems like setting auto-align doesn't do anything, the table still realigns whenever I drop out of insert mode, even when setting it to 0?
@kflak if you set g:table_mode_auto_align = 0 and restart vim, it should take effect.
OK, think I figured it out! I was working on a table in vimwiki, and vimwiki has its very own way of dealing with tables... doh... So obviously things are going to crash head-on when I have two plugins fighting over who gets to do what at the same time.
@kflak Interesting, kindly check by disabling vimwiki's table handling. Let me know if it's still an issue ?
Seems to be nice and snappy when using it in a regular markdown file, when vimwiki is not in play.