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 Nov 19, 2024
1 parent c9cdb33 commit 6b66a94
Showing 1 changed file with 69 additions and 17 deletions.
86 changes: 69 additions & 17 deletions doc/winmove.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,46 @@ active during modes.

>lua
require('winmove').configure({
highlights = {
move = "Search", -- Highlight group for move mode
},
wrap_around = true, -- Wrap around edges when moving windows
keymaps = {
help = "?", -- Open floating window with help for the current mode
help_close = "q", -- Close the floating help window
quit = "q", -- Quit current mode
toggle_mode = "<tab>", -- Toggle between modes when in a mode
},
modes = {
move = {
left = "h", -- Move window left
down = "j", -- Move window down
up = "k", -- Move window up
right = "l", -- Move window right
far_left = "H", -- Move window far left and maximize it
far_down = "J", -- Move window down and maximize it
far_up = "K", -- Move window up and maximize it
far_right = "L", -- Move window right and maximize it
split_left = "sh", -- Create a split with the window on the left
split_down = "sj", -- Create a split with the window below
split_up = "sk", -- Create a split with the window above
split_right = "sl", -- Create a split with the window on the right
highlight = "Visual", -- Highlight group for move mode
at_edge = {
horizontal = at_edge.AtEdge.None, -- Behaviour at horizontal edges
vertical = at_edge.AtEdge.None, -- Behaviour at vertical edges
},
keymaps = {
left = "h", -- Move window left
down = "j", -- Move window down
up = "k", -- Move window up
right = "l", -- Move window right
far_left = "H", -- Move window far left and maximize it
far_down = "J", -- Move window down and maximize it
far_up = "K", -- Move window up and maximize it
far_right = "L", -- Move window right and maximize it
split_left = "sh", -- Create a split with the window on the left
split_down = "sj", -- Create a split with the window below
split_up = "sk", -- Create a split with the window above
split_right = "sl", -- Create a split with the window on the right
},
},
swap = {
highlight = "Substitute", -- Highlight group for swap mode
at_edge = {
horizontal = at_edge.AtEdge.None, -- Behaviour at horizontal edges
vertical = at_edge.AtEdge.None, -- Behaviour at vertical edges
},
keymaps = {
left = "h", -- Swap left
down = "j", -- Swap down
up = "k", -- Swap up
right = "l", -- Swap right
},
},
},
})
Expand Down Expand Up @@ -106,7 +125,7 @@ Get the current version of `winmove`.

WINMOVE.CURRENT_MODE

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


WINMOVE.START_MODE
Expand All @@ -119,6 +138,7 @@ Start a mode.

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

Expand Down Expand Up @@ -173,6 +193,38 @@ current window). See |winmove-this-showcase|.
<


WINMOVE.SWAP_WINDOW_IN_DIRECTION

Swap a window in a given direction (does not need to be the current window).

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

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


WINMOVE.SWAP_WINDOW

Swap a window (does not need to be the current window). When called the first
time, highlights the selected window for swapping. When called the second time
with another window will swap the two selected windows.

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

-- Example:
winmove.swap_window(1000)
winmove.swap_window(1000)
<


CONTRIBUTING *winmove-contributing*

See here </CONTRIBUTING.md>.
Expand Down

0 comments on commit 6b66a94

Please sign in to comment.