Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying selections with path patterns #4

Open
Screwtapello opened this issue Dec 29, 2018 · 1 comment
Open

Modifying selections with path patterns #4

Screwtapello opened this issue Dec 29, 2018 · 1 comment

Comments

@Screwtapello
Copy link
Contributor

Raw Kakoune has commands to add and move selections through the file's linear structure, like h and C and ]p.

kak-tree has commands to add and move selections through the file's hierarchical structure, like tree-select-node and tree-select-prev-node and tree-select-children.

Raw Kakoune also has commands to sub-select and filter selections based on the file's linear structure, like s and k.

kak-tree should have commands to sub-select and filter selections based on the file's hierarchical structure:

  • tree-select-nodes KIND selects all the KIND nodes wholly contained within an existing selection
  • tree-split-nodes KIND slices the KIND nodes out of existing selections
    • not so useful in a hierarchical context, but for completeness and by analogy with Kakoune's core operators
  • tree-keep-matching KIND discards selections that do not wholly contain at least one KIND node
  • tree-kill-matching KIND discards selections that do wholly contain at least one KIND node

Ideally, these commands should use -shell-script-candidates to let Kakoune auto-complete the possible kinds for the current file.

There's possible extension here for kind-paths, like arguments/string_literal to only select string_literals directly inside an arguments or /arguments//string_literal to select string_literals anywhere inside whichever selections exactly cover an arguments, but that's all polish and future extension work.

@ul
Copy link
Owner

ul commented Jan 2, 2019

Just to track progress: tree-select-nodes KIND is done by tree-select-children which takes an optional parameter KIND. Other commands are not implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants