nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
3.46k stars 52 forks source link

Support for clockwise/counterclockwise navigation #248

Open patrikkj opened 1 month ago

patrikkj commented 1 month ago

Thank you for building a great tool!

One thing that I've missed is the ability to focus, move and join-with using clockwise/counterclockwise navigation, akin to mod1 + j, mod1 + k etc. in Amethyst. Alternative names could be next/previous.

Features:

Example:

h_tiles
├── window_1 (focused)
└── v_tiles
    ├── window_2 (prev. focused)
    └── window_3

navigating to window_3 in this case requires two actions, right which would take you to window_2 followed by down. This could have been done using a single ccw action.

nikitabobko commented 1 month ago

How should more complicated layouts work in this case?

h_tiles
  window1
  v_tiles
    window2
    window3
  window4
patrikkj commented 1 month ago

I think an angle-based heuristic could make sense:

image

Regular in-order tree traversal using next and previous could also go a long way, eg. win1 -> win2 -> win3 -> win4 in your example.

nffdiogosilva commented 1 month ago

I would also like to have this feature :)

codemac commented 1 month ago

Would love this option as well. In many cases I have 2, maybe 3 windows.

The complex layout options is when hjkl works better, but for 90% of the time I basically want "some other" window of which is either one or two windows.

nikitabobko commented 1 month ago

Given AeroSpace tree nature, a more well-defined algorithm would be to add possibility to focus next/prev window in DFS (Depth-first search) order

For simple layouts, it will work exactly as clockwise/counterclockwise

But it's yet unclear how to make it work with move and join-with commands (maybe it's not needed)

Though next-dfs/prev-dfs works good with upcoming swap command #8