{"id":13727502,"url":"https://github.com/andymass/vim-tradewinds","last_synced_at":"2025-03-15T17:28:52.208Z","repository":{"id":100764495,"uuid":"141038872","full_name":"andymass/vim-tradewinds","owner":"andymass","description":"the missing window movement","archived":false,"fork":false,"pushed_at":"2019-10-05T13:08:45.000Z","size":14,"stargazers_count":94,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T07:28:35.042Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andymass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-15T15:38:49.000Z","updated_at":"2024-12-23T18:48:56.000Z","dependencies_parsed_at":"2023-06-09T17:15:10.538Z","dependency_job_id":null,"html_url":"https://github.com/andymass/vim-tradewinds","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymass%2Fvim-tradewinds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymass%2Fvim-tradewinds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymass%2Fvim-tradewinds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymass%2Fvim-tradewinds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andymass","download_url":"https://codeload.github.com/andymass/vim-tradewinds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243765572,"owners_count":20344622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:04:02.574Z","updated_at":"2025-03-15T17:28:52.185Z","avatar_url":"https://github.com/andymass.png","language":"Vim script","funding_links":[],"categories":["Vim Script","Vim script"],"sub_categories":[],"readme":"\n# vim trade winds\n\nThe missing window movement.\n\n\u003cimg src='https://user-images.githubusercontent.com/6655373/42728788-11285302-8791-11e8-9633-f9f5876a8560.jpg' width='300px' alt='we practically did'\u003e\n\nThis plugin is best explained with a diagram.  In the following example,\nsuppose you are in \"current win\" and would like to move it beneath the\nleft most window.  This normally would require you to move to the left\nwindow, split it, open the correct buffer, and then finally close the\noriginal window.\n\ntrade winds simplifies this procedure by introducing a series of maps\nwhich allow you to move windows into other windows, causing them to be\nsplit.  They are `ctrl-w g` followed by the usual `hjkl` motions.\n\n    +-------------+---------------+           +-------------+---------------+\n    |             |               |           |             |               |\n    |             |               |           |             |               |\n    |             +---------------+           |             |               |\n    |             |               | ctrl-w gh |             +---------------+\n    |             |               |           |             |               |\n    |             +---------------+           +-------------+               |\n    |             |               | +-------\u003e |             |               |\n    |             |  current win  |           | current win |               |\n    |             |               |           |             |               |\n    +-------------+---------------+           +-------------+---------------+\n\nThis is referred to as a soft move, as opposed to vim's hard moves\n`ctrl-w HJKL` which place windows as far as possible in the given\ndirection.\n\nLikewise, if you would like to move windows down into a split,\n\n    +-------------+-------+-------+           +-----------------+-----------+\n    |             |       |       |           |                 |           |\n    |             |       |       |           |                 |           |\n    | current win |       |       |           |                 |           |\n    |             |       |       | ctrl-w gj |                 |           |\n    |             |       |       |           |                 |           |\n    +-------------+-------+-------+           +-------------+---+-----------+\n    |                             | +-------\u003e |             |               |\n    |                             |           | current win |               |\n    |                             |           |             |               |\n    +-----------------------------+           +-------------+---------------+\n\ntrade winds also locally converts horizontal splits into vertical ones and\nvice-versa.\n\n    +---+-----------------+-------+           +---+---------+-------+-------+\n    |   |                 |       |           |   |         |       |       |\n    |   |                 |   4   |           | 1 | current | some  |       |\n    |   |   current win   |       |           |   | win     | buffer|       |\n    |   |                 |       | ctrl-w gj |   |         |       |       |\n    |   |                 |       |           |   |         |       |       |\n    |   +-----------------+       |           +   |         |       |       |\n    |   |                 |       | +-------\u003e |   |         |       |       |\n    |   |   some buffer   |       |           |   |         |       |       |\n    |   |                 |       |           |   |         |       |       |\n    +---+-----------------+-------+           +---+---------+-------+-------+\n\nOf course, you may have to resize the windows yourself.  You may prefer\nto use the option `equalalways`.\n\nIf the window is already touching a side of the tab page, `ctrl-w gh`\nbehaves just like `ctrl-w H` (etc).  This means if you use a soft move\nrepeatedly, a window will eventually end up all the way in a particular\ndirection.\n\n    +-------------+-------+-------+           +-------------+-------+-------+\n    |             |       |       |           |             |       |       |\n    |             |       |       |           |             |       |       |\n    | current win |       |       |           |             |       |       |\n    |             |       |       | ctrl-w gh |             |       |       |\n    |             |       |       |           | current win |       |       |\n    |-------------+-------+-------|           |             +-------+-------+\n    |                             | +-------\u003e |             |               |\n    |                             |           |             |               |\n    |                             |           |             |               |\n    +-----------------------------+           +-------------+---------------+\n\n## Installation\n\nRequires vim 8.0.1364 or neovim (exact version uncertain).\n\nIf you use [vim-plug](https://github.com/junegunn/vim-plug), then add the\nfollowing line to your vimrc file:\n\n```vim\nPlug 'andymass/vim-tradewinds'\n```\n\nand then use `:PlugInstall`.  Or, you can use vim's built-in plugin system\n(`:help packadd`) or any other plugin manager.\n\n## Maps\n\n    \u003cc-w\u003egh: soft move left\n    \u003cc-w\u003egj: soft move down\n    \u003cc-w\u003egk: soft move up\n    \u003cc-w\u003egl: soft move right\n\nTo disable all maps, use\n```vim\nlet g:tradewinds_no_maps = 1\n```\n\nIf you would like to change the map prefix from `ctrl-w g`, use for\ninstance,\n```vim\nlet g:tradewinds_prefix = '\u003cc-w\u003ee'\n```\n\nIf you want full control, make your own mappings\n```vim\nnmap \u003cleader\u003eh \u003cplug\u003e(tradewinds-h)\nnmap \u003cleader\u003ej \u003cplug\u003e(tradewinds-j)\nnmap \u003cleader\u003ek \u003cplug\u003e(tradewinds-k)\nnmap \u003cleader\u003el \u003cplug\u003e(tradewinds-l)\n```\n\ntrade winds won't try to make its usual maps if you have made your own,\nand it wont step on your existing maps.\n\nAlternatively, you can make maps which use the `TradewindsMove` command:\n```vim\nlet g:tradewinds_no_maps = 1\n\nnnoremap \u003csilent\u003e \u003cc-w\u003eg\u003cleft\u003e  :TradewindsMove h\u003ccr\u003e\nnnoremap \u003csilent\u003e \u003cc-w\u003eg\u003cdown\u003e  :TradewindsMove j\u003ccr\u003e\nnnoremap \u003csilent\u003e \u003cc-w\u003eg\u003cup\u003e    :TradewindsMove k\u003ccr\u003e\nnnoremap \u003csilent\u003e \u003cc-w\u003eg\u003cright\u003e :TradewindsMove l\u003ccr\u003e\n```\n\n## Customization\n\nBefore moving a window, trade winds looks for a variable named\n`g:tradewinds#prepare`.  This can be set to a reference or name of a\nfunction which takes two arguments: the current window number and the\ntarget window number.  Returning 1 will cancel the movement.\n\nAfter a window move is performed, trade winds fires the `User` autocmd\n`TradeWindsAfterVoyage`.  This can be used, for example, to fix up\nstatuslines or other window properties:\n\n    autocmd User TradeWindsAfterVoyage call DoSomething()\n\n## Caveats\n\nThe windows are not actually moving.  Instead, a new window is created\ncontaining the correct buffer and then old one is closed.  This could lead\nto unpredictable results.  For example, plugins which rely on `w:`\nvariables being set in particular ways may have trouble.\n\nIf you notice any problems, please open an issue.\n\n## Self-promotion\n\nCheck out my other plugin,\n[match-up](https://github.com/andymass/vim-matchup).\n\n## Acknowledgments\n\nThis plugin was inspired by Scott Pierce's [vim-window][1].  In that\nplugin, the `ctrl-w g[hjkl]` are referred to as \"glue window\" and behave\nvery differently.\n\n[1]: https://github.com/ddrscott/vim-window\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymass%2Fvim-tradewinds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandymass%2Fvim-tradewinds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymass%2Fvim-tradewinds/lists"}