{"id":19638984,"url":"https://github.com/savetheclocktower/atom-inline-autocomplete-textmate","last_synced_at":"2025-07-21T03:03:35.703Z","repository":{"id":27229945,"uuid":"112964788","full_name":"savetheclocktower/atom-inline-autocomplete-textmate","owner":"savetheclocktower","description":"Inline autocompletion for TextMate 2 switchers","archived":false,"fork":false,"pushed_at":"2023-04-04T20:42:34.000Z","size":605,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T17:55:15.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/savetheclocktower.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":"2017-12-03T21:21:40.000Z","updated_at":"2023-02-20T08:16:35.000Z","dependencies_parsed_at":"2024-11-11T12:43:40.938Z","dependency_job_id":"71224fa6-91ee-456c-adfa-08c3ae0a6a26","html_url":"https://github.com/savetheclocktower/atom-inline-autocomplete-textmate","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savetheclocktower%2Fatom-inline-autocomplete-textmate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savetheclocktower%2Fatom-inline-autocomplete-textmate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savetheclocktower%2Fatom-inline-autocomplete-textmate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savetheclocktower%2Fatom-inline-autocomplete-textmate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savetheclocktower","download_url":"https://codeload.github.com/savetheclocktower/atom-inline-autocomplete-textmate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240942747,"owners_count":19882269,"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-11-11T12:43:28.335Z","updated_at":"2025-02-26T22:23:02.176Z","avatar_url":"https://github.com/savetheclocktower.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# inline-autocomplete-textmate\n\nA spiritual fork of [`inline-autocomplete`][inline-autocomplete] that aims to work (almost) exactly like TextMate 2’s autocompletion.\n\nI wrote it for switchers like me who want to pretend Atom is actually TextMate 2.\n\n## What does that mean?\n\n[Here’s how autocompleting works in TextMate][textmate]. Assume you've got a file that looks like this, except that `^` signifies where the cursor is:\n\n```\nfooBar\nfooThud\nfooBazThud\nfooTrozThud\n\n^\n```\n\n### End-of-word completion\n\n1. Type `foo`. Press \u003ckbd\u003eEsc\u003c/kbd\u003e.\n2. TextMate finds all the tokens in the current file that begin with `foo`, ordered by proximity to the cursor.\n3. TextMate fills in the nearest match (`fooTrozThud`) and puts the cursor at the end.\n4. If you press \u003ckbd\u003eEsc\u003c/kbd\u003e again, TextMate replaces it with the next nearest match (`fooBazThud`). You can keep pressing \u003ckbd\u003eEsc\u003c/kbd\u003e to cycle through the matches, or \u003ckbd\u003eShift-Esc\u003c/kbd\u003e to cycle backwards.\n5. You can keep cycling either way until you move the cursor or start typing.\n\n### Middle-of-word completion\n\n1. Type `fooThud` and move the cursor to the left of the capital T. Press \u003ckbd\u003eEsc\u003c/kbd\u003e.\n2. TextMate finds all the tokens in the current file that begin with `foo` and end with `Thud` (ignoring `fooThud` if it exists), ordered by proximity to the cursor.\n3. TextMate fills in the nearest match (`fooTrozThud`) and moves the cursor so that it's still to the left of the capital T.\n4. Otherwise behaves identically to end-of-word completion.\n\n### Beginning-of-word completion\n\n1. Type `Thud` and move the cursor to the left of the capital T. Press \u003ckbd\u003eEsc\u003c/kbd\u003e.\n2. TextMate finds all the tokens in the current file that end with `Thud`, ordered by proximity to the cursor.\n3. TextMate fills in the nearest match (`fooTrozThud`) and moves the cursor so that it's still to the left of the capital T.\n4. Otherwise behaves identically to end-of-word completion.\n\n## Is anything added?\n\nTextMate 2’s autocompletion suggestions are always restricted to tokens in the same buffer. I kept one enhancement from `inline-autocomplete`, but changed it to be more conservative. Instead of an option to suggest words across all open buffers, `inline-autocomplete-textmate` has an option to suggest words across all _visible_ buffers.\n\n### What’s a visible buffer?\n\nWhenever you create a new pane in your workspace — for instance, by right-clicking on a tab and selecting **Split Right** — you’re creating a new visible buffer. This package finds visible buffers like so: for each pane in the workspace, consider the pane’s active item. If it’s a text editor, its buffer is added to the list of buffers from which we draw completion suggestions.\n\n### Why visible buffers instead of open buffers?\n\nWhy? For selfish reasons. I always have _far_ too many tabs open, and there’s no particular significance to the set of tabs that happen to be open in my workspace at once. But if I’ve set up my workspace to have more than one editor pane, it’s usually so that I can refer to one file as I’m writing another, and in those situations it’s immensely useful to have both files’ words as candidates for autocompletion.\n\nA future version of this package _might_ turn this setting from a checkbox to a dropdown and allow you to choose between three options: active buffer only, all visible buffers, or all open buffers.\n\n### You said that suggestions are “ordered by proximity to the cursor.” How can words in _other buffers_ have a proximity to the cursor?\n\nGood question! They can’t. But we’ll pretend they can in order to deliver vaguely consistent behavior. The only thing you need to know is that completions from the current buffer are _always_ more proximate to the cursor than completions from different buffers.\n\nIn other words, when you’re cycling through autocompletion suggestions (in the forward direction), you’ll always see _all_ of the completion options from the current buffer before you see _any_ options from other buffers.\n\n## Is anything left out?\n\nYes. TextMate 2’s concept of scope-specific “character classes” is left unimplemented; my experience is that it misfires more often than it helps. I wouldn’t rule out its addition as a setting in some future version.\n\nI also removed a feature that was present in `inline-autocomplete`: suggesting keywords for the current scope even if they aren’t present in the buffer. I don’t think I’ve needed to autocomplete a keyword in my entire coding life.\n\n## Any caveats?\n\nYes. TextMate binds autocompletion to the \u003ckbd\u003eEsc\u003c/kbd\u003e key, but \u003ckbd\u003eEsc\u003c/kbd\u003e is already used for several things in Atom, so if we’re not careful we run the risk of breaking those other functions.\n\nHence there’s a setting called “Escape-key mode” that is enabled by default. In this mode, the package will ignore an \u003ckbd\u003eEsc\u003c/kbd\u003e keypress if it thinks that the user pressed it for a different reason. For example:\n\n1. \u003ckbd\u003eEsc\u003c/kbd\u003e can be used to cancel a multi-cursor operation, so we skip autocompletion when there is more than one cursor. (Autocompletion operates only on the last cursor anyway, so this is no great loss.)\n2. \u003ckbd\u003eEsc\u003c/kbd\u003e can be used to dismiss notifications, so we skip autocompletion when notifications are present.\n\nIf you disable the default key binding and map `inline-autocomplete-textmate:cycle` to a different key, you should disable this setting.\n\n[textmate]: http://blog.macromates.com/2012/clever-completion/\n[inline-autocomplete]: https://github.com/alexchee/atom-inline-autocomplete\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavetheclocktower%2Fatom-inline-autocomplete-textmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavetheclocktower%2Fatom-inline-autocomplete-textmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavetheclocktower%2Fatom-inline-autocomplete-textmate/lists"}