{"id":13479685,"url":"https://github.com/monkoose/vim9-stargate","last_synced_at":"2025-04-15T12:26:51.292Z","repository":{"id":43150431,"uuid":"384169156","full_name":"monkoose/vim9-stargate","owner":"monkoose","description":"modern alternative to easymotion written in vim9","archived":false,"fork":false,"pushed_at":"2024-01-17T13:31:37.000Z","size":66,"stargazers_count":109,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-28T20:06:57.628Z","etag":null,"topics":["vim","vim-plugin","vim9"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkoose.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":"2021-07-08T15:26:21.000Z","updated_at":"2025-03-15T17:26:31.000Z","dependencies_parsed_at":"2024-01-17T15:32:56.533Z","dependency_job_id":"ee79ad69-d577-41f8-b8bf-7bfff8bc8b5e","html_url":"https://github.com/monkoose/vim9-stargate","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/monkoose%2Fvim9-stargate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkoose%2Fvim9-stargate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkoose%2Fvim9-stargate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkoose%2Fvim9-stargate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkoose","download_url":"https://codeload.github.com/monkoose/vim9-stargate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249070434,"owners_count":21207841,"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":["vim","vim-plugin","vim9"],"created_at":"2024-07-31T16:02:21.377Z","updated_at":"2025-04-15T12:26:51.272Z","avatar_url":"https://github.com/monkoose.png","language":"Vim Script","funding_links":[],"categories":["Vim Script","Motion"],"sub_categories":[],"readme":"# vim9-stargate\n\n![Stargate Presentation](https://raw.githubusercontent.com/monkoose/stargate-images/main/stargate_presentation.gif)\n\nYou can think of **stargate** as simplified modern alternative to\n[easymotion](https://github.com/easymotion/vim-easymotion) for vim 8.2+. It\nuses [popups windows](https://vimhelp.org/popup.txt.html) to show hints, so it\nwill not modify the content of your buffer and because of that linter plugins\nwill not get mad. It is created for just one purpose - jump to any visible\ncharacter in the current window without thinking of where your cursor is.\nStargate do not support all the features of easymotion and will never do.\n\n## Motivation\n\nThere are few things that I miss in easymotion. First is already mentioned\nproblem with linter plugins, and the second one is that if you are using\nnon-English language in your code/text it makes harder to navigate in a buffer\nwith easymotion, because jumping to non-English character requires switching\nyour locale multiple times (first to choose this character, and second to go\nback to English and select a hint). Options section for `g:stargate_keymaps`\ndescribe how you can configure stargate to work with non-English text easier.\n\n## Usage\n\nStargate by default doesn't add any command or mapping. But at the same time it\ndoesn't add anything to your vim startup time. So to use this plugin, you just\nneed to create a mapping and call stargate function, like so\n```vim\n\" For 1 character to search before showing hints\nnoremap \u003cleader\u003ef \u003cCmd\u003ecall stargate#OKvim(1)\u003cCR\u003e\n\" For 2 consecutive characters to search\nnoremap \u003cleader\u003eF \u003cCmd\u003ecall stargate#OKvim(2)\u003cCR\u003e\n\n\" Instead of 1 or 2 you can use any higher number, but it isn't much practical\n\" and it is easier to use `/` or `?` for that\n```\n**Notice** that it is `noremap` (not `nnoremap`) this allows stargate to work not\nonly in normal mode, but also in visual and operator-pending modes. Do not use\n`:call ...` (`\u003cCmd\u003ecall ...` is required) or plugin will behave not as you want\nit to.\n\nTo change current window when stargate is enabled (but not in a hints\nmode) just press `\u003cC-w\u003e`, so then you can choose window label to swap to it\n(`space` to return to the current window). If for some reason you want to use\nthis feature outside of stargate plugin itself you can map provided function\nto some convenient key\n```vim\nnnoremap \u003cleader\u003ew \u003cCmd\u003ecall stargate#Galaxy()\u003cCR\u003e\n```\nAnd here we actually use `nnoremap` this time , because it makes no sense to\nswap to another window in visual or operator-pending modes.\n\nTo exit stargate at any moment press `\u003cEsc\u003e` or `\u003cC-c\u003e`.\n\nIf you want to use another jump locations like easymotion jump to start of a\nword, or start of a line etc. You can use `stargate#OKvim()` with a string as\nits only argument. This string is just some vim regexp.\n```vim\n\" for the start of a word\nnoremap \u003cleader\u003ew \u003cCmd\u003ecall stargate#OKvim('\\\u003c')\u003cCR\u003e\n\" for the end of a word\nnoremap \u003cleader\u003ee \u003cCmd\u003ecall stargate#OKvim('\\S\\\u003e')\u003cCR\u003e\n\" for the start of a line\nnoremap \u003cleader\u003el \u003cCmd\u003ecall stargate#OKvim('\\_^')\u003cCR\u003e\n\" for the last character on the line\nnoremap \u003cleader\u003eE \u003cCmd\u003ecall stargate#OKvim('\\S\\s*$')\u003cCR\u003e\n\" for the end of a line\nnoremap \u003cleader\u003e$ \u003cCmd\u003ecall stargate#OKvim('$')\u003cCR\u003e\n\" for any bracket, parentheses or curly bracket\nnoremap \u003cleader\u003e[ \u003cCmd\u003ecall stargate#OKvim('[(){}[\\]]')\u003cCR\u003e\n```\nAs you can see possible jump locations are limited only by your knowledge of\nvim regexp. **Note** make sure to use single quotes (literal strings) or you\nwould need to escape every backslash in a pattern.\n\n## Configuration\n\n### Options\n\n| Variable                | Description                               | Default             |\n|-------------------------|-------------------------------------------|---------------------|\n| `g:stargate_ignorecase` | Ignore case of the search.                | `v:true`            |\n| `g:stargate_limit`      | Maximum number of popups.\u003csup\u003e1\u003c/sup\u003e     | `300`               |\n| `g:stargate_chars`      | Chars used for hints.                     | `'fjdklshgaewiomc'` |\n| `g:stargate_name`       | How should VIM9000 call you.              | `'Human'`           |\n| `g:stargate_keymaps`    | Dict of all possible keymaps.\u003csup\u003e2\u003c/sup\u003e | `{}`                |\n\n**1** - This limit is required, because spawning a lot of popups is slow in vim. You\ncan increase it if you have found that it sometimes limits your search\nresults, but for any practical usage default value is enough.\n\n**2** - It is a dictionary of the keys - characters that you press and values -\nall characters you want to include in a search besides the key character. Both\nare strings. As an example for Russian language it can look like this\n```vim\nlet g:stargate_keymaps = {\n      \\ \"~\": \"Ё\",\n      \\ \"Q\": \"Й\", \"W\": \"Ц\", \"E\": \"У\", \"R\": \"К\", \"T\": \"Е\", \"Y\": \"Н\", \"U\": \"Г\", \"I\": \"Ш\", \"O\": \"Щ\", \"P\": \"З\", \"{\": \"Х\", \"}\": \"Ъ\",\n      \\  \"A\": \"Ф\", \"S\": \"Ы\", \"D\": \"В\", \"F\": \"А\", \"G\": \"П\", \"H\": \"Р\", \"J\": \"О\", \"K\": \"Л\", \"L\": \"Д\", \":\": \"Ж\", '\"': \"Э\",\n      \\   \"Z\": \"Я\", \"X\": \"Ч\", \"C\": \"С\", \"V\": \"М\", \"B\": \"И\", \"N\": \"Т\", \"M\": \"Ь\", \"\u003c\": \"Б\", \"\u003e\": \"Ю\",\n      \\ \"`\": \"ё\",\n      \\ \"q\": \"й\", \"w\": \"ц\", \"e\": \"у\", \"r\": \"к\", \"t\": \"е\", \"y\": \"н\", \"u\": \"г\", \"i\": \"ш\", \"o\": \"щ\", \"p\": \"з\", \"[\": \"х\", \"]\": \"ъ\",\n      \\  \"a\": \"ф\", \"s\": \"ы\", \"d\": \"в\", \"f\": \"а\", \"g\": \"п\", \"h\": \"р\", \"j\": \"о\", \"k\": \"л\", \"l\": \"д\", \";\": \"ж\", \"'\": \"э\",\n      \\   \"z\": \"я\", \"x\": \"ч\", \"c\": \"с\", \"v\": \"м\", \"b\": \"и\", \"n\": \"т\", \"m\": \"ь\", \",\": \"б\", \".\": \"ю\"\n      \\ }\n```\nYou can add as many chars in a string as you want, and all of them will be\nsearched for that dictionary key. As example to search for `t`, `е` (it's\nRussian е) and `ё` with only `t` search\n```vim\nlet g:stargate_keymaps = { \"t\": \"её\" }\n```\nOr to jump to any of bracket, parentheses or curly bracket on `[` search\n```vim\nlet g:stargate_keymaps = { \"[\": \"[](){}\" }\n```\n\n### Colors\n\nStargate provides some highlight groups that you can change to look good with\nyour color scheme.\n\n| Highlight group       | Description                                               |\n|-----------------------|-----------------------------------------------------------|\n| StargateFocus         | visible text of the current window when stargate invoked  |\n| StargateDesaturate    | visible text when hints are enabled                       |\n| StargateError         | text highlight when something goes wrong                  |\n| StargateLabels        | window labels                                             |\n| StargateErrorLabels   | window labels when something goes wrong                   |\n| StargateMain          | main color of the hints                                   |\n| StargateSecondary     | secondary colors of the hints                             |\n| StargateShip          | highlight for cursor position                             |\n| StargateVIM9000       | color for VIM9000 name in the command line                |\n| StargateMessage       | color of the standard message from VIM9000                |\n| StargateErrorMessage  | color of the error message from VIM9000                   |\n| StargateVisual        | color of the visual selection when stargate is active     |\n\nDefaults are\n```vim\nhighlight default StargateFocus guifg=#958c6a\nhighlight default StargateDesaturate guifg=#49423f\nhighlight default StargateError guifg=#d35b4b\nhighlight default StargateLabels guifg=#caa247 guibg=#171e2c\nhighlight default StargateErrorLabels guifg=#caa247 guibg=#551414\nhighlight default StargateMain guifg=#f2119c gui=bold cterm=bold\nhighlight default StargateSecondary guifg=#11eb9c gui=bold cterm=bold\nhighlight default StargateShip guifg=#111111 guibg=#caa247\nhighlight default StargateVIM9000 guifg=#111111 guibg=#b2809f gui=bold cterm=bold\nhighlight default StargateMessage guifg=#a5b844\nhighlight default StargateErrorMessage guifg=#e36659\nhighlight default link StargateVisual Visual\n```\n\nRemove `default` from this list and add any highlight group you want to change\ninto your vimrc.\n\nChange StargateVisual when visual selection highlight of the current\ncolorscheme has bad contrast with other stargate colors.\n\n## FAQ\n\n- **What are this weird naming in the source code?**\n\n  Just for fun\n  [INTRODUCTION](https://github.com/monkoose/vim9-stargate/blob/main/INTRODUCTION.md)\n  should explain it a little bit.\n\n## TODO\n\n- [x] Add vim documentation\n- [ ] Add tests\n- [ ] Improve text grammar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkoose%2Fvim9-stargate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkoose%2Fvim9-stargate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkoose%2Fvim9-stargate/lists"}