litee.nvim icon indicating copy to clipboard operation
litee.nvim copied to clipboard

Use vim/neovim builtin keybinding to open/close tree node

Open leaxoy opened this issue 4 years ago • 4 comments

Now, this plugin use zo open tree node, zc close tree node. But no keymap to toggle tree node. So I think it's better to use za toggle tree node like fold.

leaxoy avatar Jan 04 '22 05:01 leaxoy

zA toggle all fold under cursor recursively za toggle current fold under cursor zC close all fold under cursor recursively zc close current fold zO open all fold under cursor resursively zo open current fold zR open all fold among whole tree

leaxoy avatar Jan 04 '22 05:01 leaxoy

I generally like the toggle command.

Things get a bit more complicated when we deal with recursive opens. I dont think these are a good idea in most cases.

In the calltree case, loops can exist, and recursive opens can lead to the open never finishing.

In filetree, directories are lazily evaluated, so recursive open of them can result in a long wait as you open a heavily nested directory.

The recursive close operations should be okay.

ldelossa avatar Jan 04 '22 13:01 ldelossa

Sorry, I didn't fully consider this situation, zA can be reserved, but za is conveniently to toggle fold.

leaxoy avatar Jan 05 '22 06:01 leaxoy

Yup I agree, a toggle will be useful.

Ill create a pr at each plugin repo (calltree,filetree,symboltree) to accomplish this.

ldelossa avatar Jan 05 '22 13:01 ldelossa