bew / dotfiles

All my dotfiles in one place!
43 stars 3 forks source link

Explore ability to group buffers arbitrarily #54

Open bew opened 3 years ago

bew commented 3 years ago

Depends on #63


Plugin to read on: https://github.com/chimay/wheel

Currently i'm mostly using buffer groups using tabs, managed with CtrlSpace plugin, but now I want to group tabs by larger topics... Maybe there's a better way...

bew commented 3 years ago

There is the really nice builtin feature arglist, used to have a subset of the bufferlist and be able to navigate from files to files, or run commands on all of them.

I've been playing with it lately, very nice! Oh! And it seems multiple lists are supported (see :h {arglist}) with local/global. local means per window AFAIU \o/

But these are not named lists I can easily play with..

While searching for plugins with advanced arglist usages, I've found: https://github.com/inkarkat/vim-ArgsAndMore which has lots of commands to do various things with tablist, biglist, arglist,... But at first glance I'm not a 100% fan to have that much specialized commands and would prefer to have a few composable ones.

bew commented 3 years ago

The thinglist plugin idea (#63) could be used to implement a plugin for this on top of it 👀

bew commented 2 years ago

With tags! And a set of commands to (fuzzy) open/filter files by tags query (model postgre !low for all model files for postgres, excluding lowlevel files)

Then a nvim tab could have tag queries populating it, so it's easy to have by-topic set of files accessible.

Example of wanted groups for a bunch of files I'm working on right now:

some_sdk/models/postgres/backup.py           | tags: model backup
some_sdk/models/postgres/cluster.py          | tags: model cluster
some_sdk/models/postgres/database.py         | tags: model database
some_sdk/models/postgres/interfaces.py       | tags: model backup cluster database

some_sdk/postgres/backups.py                 | tags: ctrl backup
some_sdk/postgres/clusters.py                | tags: ctrl cluster
some_sdk/postgres/databases.py               | tags: ctrl database

tests/unit_tests/models/postgres/test_backup.py       | tags: test model backup
tests/unit_tests/models/postgres/test_cluster.py      | tags: test model cluster
tests/unit_tests/models/postgres/test_database.py     | tags: test model database

tests/unit_tests/postgres/test_backups.py             | tags: test ctrl backup
tests/unit_tests/postgres/test_clusters.py            | tags: test ctrl cluster
tests/unit_tests/postgres/test_databases.py           | tags: test ctrl database

IDEA: config file in a repo /.file_tagging_rules.yml:

# Format: `tag_name: glob or list of globs` (could be expanded later)
code: some_sdk/**/*.py
test: tests/**/test_*.py
lowlevel: some_sdk/lowlevel/**/*.py
low-model: some_sdk/lowlevel/*/models/*.py
low-api: some_sdk/lowlevel/*/api/*.py

model:
- some_sdk/models/*/*.py
- tests/unit_tests/models/*/test_*.py

ctrl:
- some_sdk/*/*.py
- tests/unit_tests/*/test_*.py

x-common:
- some_sdk/common/*.py
- tests/unit_tests/common/test_*.py

x-pg,x-postgres: **/postgres/**/*.py
x-kube: **/kube/**/*.py
x-block: **/block/**/*.py
x-cmaas: **/cmaas/**/*.py
x-dns: **/dns/**/*.py
x-eventbus: **/eventbus/**/*.py
x-monitoring: **/monitoring/**/*.py
x-myvault: **/myvault/**/*.py
x-ocs: **/ocs/**/*.py
x-osf: **/osf/**/*.py
x-pki: **/pki/**/*.py
x-psg: **/psg/**/*.py
x-rabbitmq: **/rabbitmq/**/*.py
x-secret: **/secret/**/*.py
x-slb: **/slb/**/*.py
x-traffic_manager: **/traffic_manager/**/*.py
bew commented 1 year ago

Neovim plugin for tagging important files https://github.com/cbochs/grapple.nvim

Might be interesting...?