vim-table-mode icon indicating copy to clipboard operation
vim-table-mode copied to clipboard

This plugin is too slow in nvim

Open Hello-LuisWu opened this issue 2 years ago • 17 comments

This plugin is too slow in nvim, I hope you can re-develop it with lua

Hello-LuisWu avatar Oct 16 '23 07:10 Hello-LuisWu

@Hello-LuisWu Can you share some examples ? I use nvim myself and haven't really seen any sluggishness.

dhruvasagar avatar Oct 18 '23 08:10 dhruvasagar

@Hello-LuisWu what's the reason it's slow in nvim instead of vim? Please keep the plugin compatible with both vim and nvim, it looks amazing :)

kaddkaka avatar Oct 24 '23 04:10 kaddkaka

I'm experiencing major slowdowns myself for large tables (200 characters wide, 80 characters tall). I just started using the plugin though, so maybe I'm doing something wrong.

bmvi-kinver avatar Nov 16 '23 12:11 bmvi-kinver

@bmvi-kinver Can you tell me what feels slow ? Is it formulas ? Is it navigation ? Is it the auto-alignment (most likely candidate) ?

dhruvasagar avatar Nov 16 '23 15:11 dhruvasagar

@bmvi-kinver Also, could you disable the table syntax by setting let g:table_mode_syntax = 0 and see if that makes a difference.

dhruvasagar avatar Nov 16 '23 15:11 dhruvasagar

@dhruvasagar it's slow in insert mode for the aforementioned table, just typing. I don't use formulas. Thanks for the suggestion! I set vim.g.table_mode_syntax = 0 in my init.lua file, and it's much faster now. Awesome plugin, by the way!

bmvi-kinver avatar Nov 16 '23 16:11 bmvi-kinver

I'm experiencing slowdowns, too. I too am using neovim.

An example table that I'm working with has rougly 70 rows, 16 columns and is 317 characters wide. It contains some special characters (unicode squares https://www.compart.com/en/unicode/U+25A1).

Most navigation commands I am using here (h,j,k,l, <C-u>, <C-d>, <C-e>, and <C-y>) are very slow. The aforementioned commands, especially when pressed several times in a row or remaining pressed, cause lag and multisecond slowdowns in TableMode.

As a consequence I have to disable TableMode when navigating large tables. When I do the slowdowns disappear fully.

BTW: the vim.g.table_mode_syntax = 0 solution fully resolves the issue for me. I too love the plugin :slightly_smiling_face:

OlivierBBB avatar Jan 06 '24 18:01 OlivierBBB

I have started work on a lua port, my experience so far with performance is that lua outperforms vimscript by quite a margin. This should help but is a fairly huge undertaking so it will take a bit to be usable. Will share updates here.

dhruvasagar avatar Jan 07 '24 03:01 dhruvasagar

I noticed in Neovim 0.9.5 on Arch Linux that a table becomes slow to navigate (j, k, h, l) if there is some text highlighted after a search (/) and the table mode is active.

When I remove the highlight, or disable table mode, performance returns back to normal.

mb720 avatar Feb 06 '24 22:02 mb720

@mb720 Like pointed out above, the issue is with the table syntax. Disabling table syntax as stated above should fix the slowness.

dhruvasagar avatar Feb 08 '24 14:02 dhruvasagar