ziontee113 / syntax-tree-surfer

A plugin for Neovim that helps you surf through your document and move elements around using the nvim-treesitter API.
MIT License
472 stars 10 forks source link

Please consider avoiding global variables #22

Open litoj opened 9 months ago

litoj commented 9 months ago

It is one thing to write code considered as bad practise, but my reason is performance - any unnecessary uses of global variables throught all kinds of plugins add up and can cause unnecessary slowdown due to longer time to access globals like vim and other, actually often used globals.

The block https://github.com/windwp/nvim-autopairs/blob/masterrfer/lua/syntax-tree-surfer/init.lua#L329 seems unnecessary - at least a lazy load should be no problem - like an option for dot repeat if not a different way to enable dot repeat altogether.

ziontee113 commented 9 months ago

The _G. global variables used in this project is to support dot repeat. PRs are welcomed if you have a better implementation :+1: