Skip to content

Commit

Permalink
Auto-generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 28, 2024
1 parent 46d5c8d commit 70cff9c
Showing 1 changed file with 98 additions and 18 deletions.
116 changes: 98 additions & 18 deletions doc/winmove.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ INSTALLING *winmove-installing*
CONFIGURATION *winmove-configuration*

If you are content with the defaults that are shown below, you don’t need to
call the `configure` function.
call the `configure` function. No default keymaps are set other than those
active during modes.

>lua
require('winmove').configure({
Expand Down Expand Up @@ -84,10 +85,7 @@ call the `configure` function.

AUTOCOMMANDS *winmove-autocommands*

You can define autocommands for when modes start and end.

- `"WinmoveModeStart"`
- `"WinmoveModeEnd"`
You can define autocommands that trigger when a mode starts and ends.

>lua
vim.api.nvim_create_autocmd("WinmoveModeStart", {
Expand All @@ -106,33 +104,106 @@ You can define autocommands for when modes start and end.

PUBLIC API *winmove-public-api*

Consider only the functions below part of the official API. All other functions
are subject to change.

Setup `winmove`.
[!WARNING] Consider only the functions below part of the public API. All other
functions are subject to change.

WINMOVE.CONFIGURE

Configure `winmove`. Also see |winmove-configuration|.


WINMOVE.VERSION

Get the current version of `winmove`.


WINMOVE.CURRENT_MODE

Check which mode is currently active. Returns `"move"`, `"resize"`, or `nil`.


WINMOVE.START_MODE

Start a mode.

>lua
winmove.configure({ ... })
---@param mode winmove.Mode
winmove.start_mode(mode)

-- Example:
winmove.start_mode(winmove.Mode.Move)
winmove.start_mode("resize")
<

Get the current version of `winmove`.

WINMOVE.STOP_MODE

Stop the current mode. Fails if no mode is currently active.


WINMOVE.MOVE_WINDOW

Move a window (does not need to be the current window). See
|winmove-a-showcase|.

>lua
winmove.version()
---@param win_id integer
---@param dir winmove.Direction
winmove.move_window(win_id, dir)

-- Example:
winmove.move_window(1000, "k")
<


WINMOVE.SPLIT_INTO

Split into a window (does not need to be the current window). See
|winmove-a-showcase|.

>lua
---@param win_id integer
---@param dir winmove.Direction
winmove.split_into(win_id, dir)

-- Example:
winmove.split_into(1000, "l")
<

Check which mode is currently active. Returns `"move"`, `"resize"`, or `nil`.

WINMOVE.MOVE_WINDOW_FAR

Move a window as far as possible in a direction (does not need to be the
current window). See |winmove-a-showcase|.

>lua
winmove.current_mode()
---@param win_id integer
---@param dir winmove.Direction
winmove.move_window_far(win_id, dir)

-- Example:
winmove.move_window_far(1000, "h")
<


[!IMPORTANT] Moving windows takes into account the cursor position of the
current window relative to the target window in the direction you are moving.
For example, if your cursor position is closest to the bottom of one window in
the target direction, the window will be moved below that window. See
|winmove-this-example| for a visual explanation.
WINMOVE.RESIZE_WINDOW

Resize a window (does not need to be the current window). See a
|winmove-showcase|.

>lua
---@param win_id integer
---@param dir winmove.Direction
---@param count integer
---@param anchor winmove.ResizeAnchor?
winmove.resize_window(win_id, dir, count, anchor)

-- Example:
winmove.resize_window(1000, "j", 3, winmove.ResizeAnchor.TopLeft)
winmove.resize_window(1000, "l", 1, winmove.ResizeAnchor.BottomRight)
<


CONTRIBUTING *winmove-contributing*

Expand All @@ -156,9 +227,18 @@ SHOWCASE *winmove-showcase*
MOVING AROUND WINDOWS ~


[!IMPORTANT] Moving windows takes into account the cursor position of the
current window relative to the target window in the direction you are moving.
For example, if your cursor position is closest to the bottom of one window in
the target direction, the window will be moved below that window. See
|winmove-this-example| for a visual explanation.

MOVING AND RESIZING WINDOWS ~


MOVING AS FAR AS POSSIBLE IN A DIRECTION ~


MOVE BETWEEN TABS ~


Expand Down

0 comments on commit 70cff9c

Please sign in to comment.