{"id":13413045,"url":"https://github.com/yorickpeterse/nvim-window","last_synced_at":"2025-04-05T04:11:00.925Z","repository":{"id":183257293,"uuid":"614616177","full_name":"yorickpeterse/nvim-window","owner":"yorickpeterse","description":"Easily jump between NeoVim windows.","archived":false,"fork":false,"pushed_at":"2025-02-03T23:34:12.000Z","size":53,"stargazers_count":149,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T03:06:52.910Z","etag":null,"topics":["neovim","nvim","plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yorickpeterse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-16T00:38:20.000Z","updated_at":"2025-03-27T05:20:38.000Z","dependencies_parsed_at":"2024-01-03T03:34:05.292Z","dependency_job_id":"f53e7b55-498c-47d0-9852-10b984cb8895","html_url":"https://github.com/yorickpeterse/nvim-window","commit_stats":null,"previous_names":["yorickpeterse/nvim-window"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Fnvim-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Fnvim-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Fnvim-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Fnvim-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yorickpeterse","download_url":"https://codeload.github.com/yorickpeterse/nvim-window/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":["neovim","nvim","plugin"],"created_at":"2024-07-30T20:01:32.754Z","updated_at":"2025-04-05T04:11:00.906Z","avatar_url":"https://github.com/yorickpeterse.png","language":"Lua","funding_links":[],"categories":["Split and Window","Lua"],"sub_categories":["Indent"],"readme":"# nvim-window\n\nA simple and opinionated NeoVim plugin for switching between windows in the\ncurrent tab page.\n\n**NOTE:** this plugin is considered feature complete, and as such no new\nfeatures will be added _unless_ I have a need for it myself.\n\n## Rationale\n\nIn (Neo)Vim you can navigate between windows using `Control+W`, followed by a\nmotion. For example, to move to the window on the right of the current one you'd\npress `Control+W l`. This works for simple scenarios, but gets annoying fast.\nConsider the following window layout:\n\n```\n+---+---+---+---+\n|   |   |   |   |\n| A | B | C | D |\n|   |   |   |   |\n+---+---+---+---+\n```\n\nAssuming window A is the current window your cursor is in, and you want to move\nto window C, you might press `Control+W 2l`. This is doable, but having to count\nthe number of steps every time gets tedious.\n\nIt gets more annoying when you want to move to a window above your current one,\nbut the window is on the right:\n\n```\n+---+---+---+\n|   |   |   |\n| A | B | C |\n|   |   |   |\n+---+---+---+\n|     D     |\n+-----------+\n```\n\nAssuming window D is active and you want to move to window B, you'd have to take\ntwo steps:\n\n- `Control+W k` to move to window A\n- `Control+W l` to move to window B\n\nWhile there may be other ways of doing this, the use of `Control+W` is probably\nthe easiest approach to remember; and it's still annoying.\n\nThis is where nvim-window comes in: it makes it trivial to jump between windows\n(in the current tab page), without the need for knowing how far away they are or\nrelying on a fuzzy finder (and having to type out the window paths).\n\nUsing nvim-window, press your binding of choice to activate nvim-window, press\none letter (or two, if there are many windows), and the given window becomes\nactive. This makes it _much_ easier to quickly jump between windows.\n\nYou can see this in action here:\n\n[![nvim-window using floating windows](https://asciinema.org/a/659545.svg)](https://asciinema.org/a/659545)\n\nYou can also render the hints to the `statusline`:\n\n[![nvim-window using the statusline](https://asciinema.org/a/659546.svg)](https://asciinema.org/a/659546)\n\n## Requirements\n\nNeoVim 0.5 or newer\n\n## Limitations\n\n- Limited styling options to keep the code simple\n- \"Only\" handles up to 52 windows in a single tab page\n- No hinting of characters as you type (like hop.nvim), to keep the code simple\n\n## Installation\n\nFirst add this plugin using your plugin manager of choice.\n\n### lazy.nvim\n\n```lua\n{\n  \"yorickpeterse/nvim-window\",\n  keys = {\n    { \"\u003cleader\u003ewj\", \"\u003ccmd\u003elua require('nvim-window').pick()\u003ccr\u003e\", desc = \"nvim-window: Jump to window\" },\n  },\n  config = true,\n}\n```\n\n### vim-plug\n\n```vim\nPlug 'https://gitlab.com/yorickpeterse/nvim-window.git'\n```\n\nFor the exact steps necessary, please refer to your plugin manager's\ndocumentation.\n\nOnce installed you need to add a key binding, as nvim-window doesn't define any\nkey bindings for you. You can set up a binding like so:\n\n```vim\nmap \u003csilent\u003e \u003cleader\u003ew :lua require('nvim-window').pick()\u003cCR\u003e\n```\n\nI personally use comma (`,`), as this allows me to switch between windows using\n(most of the time) only two keys:\n\n```vim\nmap \u003csilent\u003e , :lua require('nvim-window').pick()\u003cCR\u003e\n```\n\n## Configuration\n\nThe default settings should be good enough for most. In case you want to change\nthem (e.g. by changing the background of the floating window), you can do so as\nfollows:\n\n```lua\nrequire('nvim-window').setup({\n  -- The characters available for hinting windows.\n  chars = {\n    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',\n    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n  },\n\n  -- A group to use for overwriting the Normal highlight group in the floating\n  -- window. This can be used to change the background color.\n  normal_hl = 'Normal',\n\n  -- The highlight group to apply to the line that contains the hint characters.\n  -- This is used to make them stand out more.\n  hint_hl = 'Bold',\n\n  -- The border style to use for the floating window.\n  border = 'single',\n\n  -- How the hints should be rendered. The possible values are:\n  --\n  -- - \"float\" (default): renders the hints using floating windows\n  -- - \"status\": renders the hints to a string and calls `redrawstatus`,\n  --   allowing you to show the hints in a status or winbar line\n  render = 'float',\n})\n```\n\nYou can place this in your `init.lua` before or after defining the mapping. You\ncan also dump it in a different Lua file; just make sure to actually load that\nfile :)\n\n## License\n\nAll source code in this repository is licensed under the Mozilla Public License\nversion 2.0, unless stated otherwise. A copy of this license can be found in the\nfile \"LICENSE\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyorickpeterse%2Fnvim-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyorickpeterse%2Fnvim-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyorickpeterse%2Fnvim-window/lists"}