do files: unlike Stata’s built-in editor on the Mac, it has syntax highlighting and other goodies via Timothy Beatty’s bundle (now hosted by Dan Byler). If you disable the default key binding and map inline-autocomplete-textmate:cycle to a different key, you should disable this setting.I recently switched to TextMate for editing Stata. (Autocompletion operates only on the last cursor anyway, so this is no great loss.)Įsc can be used to dismiss notifications, so we skip autocompletion when notifications are present. For example:Įsc can be used to dismiss the Find and Replace panel, so we skip autocompletion when any text is selected.Įsc can be used to cancel a multi-cursor operation, so we skip autocompletion when there is more than one cursor. In this mode, the package will ignore an Esc keypress if it thinks that the user pressed it for a different reason. Hence there’s a setting called “Escape-key mode” that is enabled by default. TextMate binds autocompletion to the Esc key, but Esc is already used for several things in Atom, so if we’re not careful we run the risk of breaking those other functions. I don’t think I’ve needed to autocomplete a keyword in my entire coding life. I 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 wouldn’t rule out its addition as a setting in some future version. TextMate 2’s concept of scope-specific “character classes” is left unimplemented my experience is that it misfires more often than it helps. In 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. 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. But we’ll pretend they can in order to deliver vaguely consistent behavior. You said that suggestions are “ordered by proximity to the cursor.” How can words in other buffers have a proximity to the cursor? 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.Ī 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. 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. Why visible buffers instead of open buffers?
If it’s a text editor, its buffer is added to the list of buffers from which we draw completion suggestions. This package finds visible buffers like so: for each pane in the workspace, consider the pane’s active item. Whenever 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. Instead of an option to suggest words across all open buffers, inline-autocomplete-textmate has an option to suggest words across all visible buffers. I kept one enhancement from inline-autocomplete, but changed it to be more conservative. TextMate 2’s autocompletion suggestions are always restricted to tokens in the same buffer. TextMate finds all the tokens in the current file that end with Thud, ordered by proximity to the cursor.Type Thud and move the cursor to the left of the capital T.Otherwise behaves identically to end-of-word completion.TextMate fills in the nearest match ( fooTrozThud) and moves the cursor so that it's still to the left of the capital T.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.Type fooThud and move the cursor to the left of the capital T.You can keep cycling either way until you move the cursor or start typing.You can keep pressing Esc to cycle through the matches, or Shift-Esc to cycle backwards. If you press Esc again, TextMate replaces it with the next nearest match ( fooBazThud).TextMate fills in the nearest match ( fooTrozThud) and puts the cursor at the end.TextMate finds all the tokens in the current file that begin with foo, ordered by proximity to the cursor.Assume you've got a file that looks like this, except that ^ signifies where the cursor is: fooBar Here’s how autocompleting works in TextMate. I wrote it for switchers like me who want to pretend Atom is actually TextMate 2. A spiritual fork of inline-autocomplete that aims to work (almost) exactly like TextMate 2’s autocompletion.