How to stop the autocomplete when I do ( or "?


#1

you see I touch type and when I type a ( a ) automatically appears or when I type a " a " automatically appears.

Can someone tell me how to stop this from happening otherwise I’m going back to notpad++

shame the colour in atom is cool.


#2

Edit: I suspect my 2nd post actually provides the solution. Leaving this post here in case it is helpful for someone.

Auto-completion is offered by the autocomplete-plus package and the various autocomplete-x plugins, where x typically stands for the language it provides auto-completion for.

Go to Settings -> Packages -> Autocomplete Plus:

[Screenshot was supposed to go here. Stuck on ‘Uploading 100%’.]

I assume that autocomplete suggests ‘automatically’ because somewhere in the file (or in another open file if you have Include Completions From All Buffers enabled) the word ‘automatically’ appears. If this is indeed the case, there are two ways to stop autocomplete from offering you ‘automatically’ after you only typed an ‘a’:

  1. Increase the Minimum Word Length. This setting affects after how many characters suggestions show up. The default value is 3, it appears you have it set to 1.
  2. Untick Enable Build-In Provider. The Build-In Provider is language agnostic and tries to provide suggestions based some form of substring or subsequence matching (I assume).
  3. Untick Show Suggestions On Keystroke. This will disable the automatically appearing suggestions altogether. You can still ask for suggestions by means of the autocomplete-plus:activate command, which is by default bound to Ctrl + Space on Windows.

I recommend increasing the Minimum Word Length first and see if that helps with your use case. While the Build-In Provider has no awareness of the context (e.g. it could happily suggest a class name if you are declaring a variable), it can be useful in other scenarios. If you simply dislike suggestions to automatically appear while you type, unticking Show Suggestions On Keystroke will prevent that.

Try to play around with the settings a bit. If you are writing in a specific language, see if there is a language specific plugin for autocomplete-plus:


These plugins are typically context aware and will give much better suggestions than the Build-In Provider can give you.


#3

I realise now it is likely my reading skills failed me and you mean it automatically inserts a closing bracket or another quotation mark after inserting their opening variant. This is done by the bracket-matcher package. You can untick Autocomplete Brackets and Autocomplete Smart Quotes to turn that off.


#4

This is what I see, I have no option to uncheck those choices


#5

bizzare situation


#6

It appears bracket-matcher is disabled (since there is a button to enable it in your screenshot), so it shouldn’t be auto-completing brackets or smart quotes to begin with. It could be another package is providing something similar.

Can you try to open Atom in Safe Mode? You can do this by typing atom --safe on the command line (Command Prompt on Windows). In Safe Mode, no community packages are loaded.

If the problem does not appear in Safe Mode there is likely a community package auto-completing your brackets or quotes. If you have Emmet installed, try to disable that package to see if it solves your problem as it sometimes causes issues.

If the problem still appears in Safe Mode I am at a loss what the issue could be.


#7

thanks, working properly now after loading safe mode


#8

…in which case you have a community package that does it for you in this instance.
If you want to use atom in normal mode, find that package and disable or uninstall it.


#9

So now we know there is a community package that is auto-completing your brackets or quotes.

To identify which package is causing the issue, take a look at the community packages you have installed. They will appear under the Community Packages header in the Settings view. You don’t need to check any Core Package because Safe Mode verified they do cause the issue. If you only have a few packages installed, see if any of the packages’ settings show anything about auto-completion. If not, simply try to disable the packages one by one.

If you have a lot of community packages installed, this can be tedious work. Try @mark_hahn’s package-cop to help finding the offender.


#10

Or maybe just reload Atom… I disabled bracket matcher package, but its behavior was only disabled after I reloaded Atom.

PS I’ll post an issue about this on the package’s repo

PPS Issue here: https://github.com/atom/bracket-matcher/issues/156


#11

I agree. As a touch typist, this “feature” has always confused me. I don’t even understand how it is supposed to be helpful. When the editor automatically inserts a closing ", you still need to get your cursor to the other side of it to continue typing. What do the authors of this feature actually expect you to do to do that? Hit the right arrow?? I end up just typing the closing " again because it’s easier, which makes the feature completely pointless. I can see it when typing a curly bracket when typing a new function say (even though it saves you all of two keystrokes), but only if you are authoring a new block from scratch, and say, not editing an existing line. Parentheses and square brackets are generally kept on a single line, so it’s of no use there either.

The rare occasion this is actually helpful is so overwhelmed by it being an annoyance most of the time that I wonder why this even exists, let alone is apparently enabled by default??


#12

I’m going to leave aside the most obvious answer: it makes sure that you’re never missing a closing bracket, parenthesis, or quote.

When you’re not typing anything after the closing bracket or quotation mark. For example:

var pizza
var cheese = true

You might want to set the type of the pizza, and type

var pizza = "pepperoni"
var cheese = true

and in that case, the feature saves keystrokes. For me, it’s nice to see that I’m inside the quote or parenthetical while I’m typing, and then I can get out of it with the closing key instead of the right arrow like a normal editor requires.

Parentheses and square brackets are generally kept on a single line, so it’s of no use there either.

No? Try typing something like ({[1,1]}) and you’ll see how it’s useful.

The rare occasion this is actually helpful is so overwhelmed by it being an annoyance most of the time that I wonder why this even exists, let alone is apparently enabled by default??

Because the developers like the feature, and I’m sure plenty of users like me do too.


#13

At any rate, starting in Atom 1.14.0 you’ll be able to fully customize which characters you want to autocomplete thanks to https://github.com/atom/bracket-matcher/pull/249.


#14

I would argue that if you know what you are coding, you should already have internalized the order those brackets should appear in. At best it is saving you three characters. And if it does autocomplete for you, how do you get to the next line? What if you need to type a semicolon? Would hitting enter not insert a newline before the autocompleted brackets? As a user you never know how each particular editor’s attempt at implementing this is going to behave. And even if the editor does have some logic to handle moving the cursor automatically, it would require putting those characters in some kind of metastate, and all that feels so dirty and unnecessary to me. I just want to have predictable control over what I’m typing and not have to be constantly sidetracked by an editor that keeps doing its own thing.

I know and use a fair number of languages and have never found quote/bracket completion to be particularly useful to me, especially as a touch-typist because I hate having to take my hands off the home row to hit the right arrow key and then have to find my place on the home row again. It means I have to look away from the screen and down at the keyboard, and maybe that doesn’t sound so bad to you but it’s actually very annoying and really slows me down. So as I said I more often than not will just type the character it autocompleted that I was already going to anyway and just hope that it absorbs it.

Personally I don’t generally like any kind of auto-insertion while I’m coding, but maybe I’m just old-school that way. On the other hand I love things like suggested completions that provide aid without interfering with my typing, and use that all the time. It’s purely a matter of control and avoiding distractions. Editors will often just enter things I had no intention of typing, forcing me to have to deal with it, when even in the best case all it would have saved me was a key typed that I had already mentally planned on typing.

I just don’t see how it’s worth it.


#15

Now you’re just being elitist. It’s not about not knowing what order the brackets are supposed to be in. It’s about typing them without having to do the tedious work of closing each one, and it’s definitely helpful for any dyslexic people who might try to type that.

At best it is saving you three characters.

And at worst it doesn’t change your flow of typing at all. A situational benefit with no downside is A+++++. And if you’re really bothered by the program’s presumption that you might want to close a bracket after opening it, you can turn the autocompletion off.

I know and use a fair number of languages and have never found quote/bracket completion to be particularly useful to me, especially as a touch-typist because I hate having to take my hands off the home row to hit the right arrow key and then have to find my place on the home row again.

Well, it’s good then that the developers thought of that and that you don’t actually have to do that, because if the cursor is on the left side of a closing bracket and you type that same character, the cursor will just skip over the closing bracket. It’s like magic.

Personally I don’t generally like any kind of auto-insertion while I’m coding

Have you heard? Nearly every part of Atom is configurable. You can make it behave however you like.

but maybe I’m just old-school that way.

Less “old-school” and more “I have strong feelings about other people not doing it the way I prefer to do it, to the point where I write multi-paragraph posts about how wrong it is instead of simply disabling the feature”.

I just don’t see how it’s worth it.

That’s fine. Don’t use it.


#16

I care about usability. I don’t apologize for that.

Auto-completion should be seen as an accessibility aid that is disabled by default. That’s my argument.

If someone can solve it in such a way that doesn’t have the problems I mentioned, I’d be happy to reconsider it. But in its current state it is just not an acceptable user interface, in my humble elitist opinion.


#17

So submit a pull request, and if the dev team disagrees, then that’s settled.

If someone can solve it in such a way that doesn’t have the problems I mentioned

What problem? The only statement of a problem I see is:

When the editor automatically inserts a closing ", you still need to get your cursor to the other side of it to continue typing. What do the authors of this feature actually expect you to do to do that? Hit the right arrow?? I end up just typing the closing " again because it’s easier, which makes the feature completely pointless.

You type ", type whatever goes inside the quotes, then type " again and you get out of it. It is seamless. The only difference is that you have a quote in front of your cursor while you’re typing, and the only problem you have stated is that the feature is “completely pointless” if you type both quotes or both brackets.


#18

So the main problems are:

  1. When the editor inserts the closing symbol, it’s not obvious whether typing that symbol again will be absorbed or if it will not. Sometimes, even in editors where it is normally absorbed, if you do something like move the cursor it will change the invisible metastate of the autocompleted character and it will no longer be absorbed.
  2. Inserting additional characters after the cursor breaks the linear stream of text entry that the cursor represents. If I type ({[ it will insert three characters after the cursor that I now have to figure out how to get on the other side of, which generally involves taking my hands off of the home row.
  3. It will often just insert extra characters that are unwanted. Such as if I delete the opening bracket of a function or block and re-type it, such tools will often insert an extraneous closing symbol.

I take back what I said about it being disabled by default. I would only argue that if most users actually prefer to not have it, which I honestly don’t know. But it definitely needs to be easily disableable, and I don’t see the option in my Atom settings. Which means it’s probably in a plugin somewhere, and therefore imo not easily disableable if you have to google how to do it.

Expanding on what I mean by predictability, let’s try some examples:

Type:
var test = "blah

Atom will insert a closing " after the cursor. Now hit Enter. The closing " moves down to the next line, when I might have assumed it wouldn’t. Hit backspace, type ". Now it’s absorbed. So that means that metastate has actually persisted even after I’ve moved away from the line.

Now type that again and this time instead of typing Enter, click somewhere else in the document, type something and then click back to the line so the cursor is in front of the closing " and type " again. It still gets absorbed!

Now type:
var test = “blah”

and close the quote yourself. Now go type something somewhere else and then put the cursor in front of the closing " and type " again. It does not get absorbed, yet it looks exactly the same as the previous example where it does.

This kind of unpredictable behavior makes it very frustrating for someone who is typing code because we can’t learn habitual behavior. In fact we can’t know reliably what the editor is going to do in any given scenario. We always have to be watching what actually happens when we type something and be ready to handle the case where it doesn’t do what we expect.


#20

This is fair. I don’t even remember when I found out that it worked like that because it probably happened on the first or second try. It’s probably reflex for most people to just keep typing, and then they happen to see the closing character get absorbed.

Sometimes, even in editors where it is normally absorbed, if you do something like move the cursor it will change the invisible metastate of the autocompleted character and it will no longer be absorbed.

Differences between editors can only be solved to a limited extent, and features like this aren’t regular enough to have conventions.

Inserting additional characters after the cursor breaks the linear stream of text entry that the cursor represents.

This is a valid criticism, but how often when you’re coding is the cursor at the end of the text? If you answer “always” because you compose everything in your head and don’t need to start off a function by scaffolding out the punctuation like

function() {
  |
}

then I would daresay that you are the exception. The above scaffold is doable just by typing function(), {, and then enter. In Notepad++, I have to type function() {}, left, then enter. It’s not a huge savings for me with Atom, but it feels so much nicer. I usually fill out if statements as I write them, but in the case of anything more complex, such as for or case, I make sure that all the punctuation is in place before I add the content because this helps me make sure that I don’t forget to close something.

It will often just insert extra characters that are unwanted. Such as if I delete the opening bracket of a function or block and re-type it, such tools will often insert an extraneous closing symbol.

This is true. It’s worth it for me.

But it definitely needs to be easily disableable, and I don’t see the option in my Atom settings. Which means it’s probably in a plugin somewhere, and therefore imo not easily disableable if you have to google how to do it.

Many of the core packages have settings that can be changed. With Atom set up as being hackable and reconfigurable, major parts of the functionality (including Find and Replace) are segregated in packages that can be disabled or overridden. This is a conceit of Atom’s that does raise the barrier to entry a bit, but it’s part of the core concept of the app. Maybe there could be an additional tab in the Settings view that aggregates core package settings and makes them more prominent.

Now go type something somewhere else and then put the cursor in front of the closing " and type " again. It does not get absorbed, yet it looks exactly the same as the previous example where it does.

When I try it, typing somewhere else doesn’t remove the metastate. Only typing over the character and triggering the absorption removes the state.


#21

Cmd+Enter on macOS or Ctrl+Enter on other platforms will insert a blank line after the current line and move the cursor to the appropriately indented cursor position. Shift+Cmd+Enter on macOS and Shift+Ctrl+Enter on other platforms will do the same thing but insert a blank line before the current one.

(These commands are useful in other situations than just bracket matching too.)

  1. Launch Atom
  2. Open Settings View using Cmd+, on macOS or Ctrl+, on other platforms
  3. Click the Packages tab on the left
  4. Type in bracket-matcher in the search box
  5. Either
    1. Click the Disable button
    2. Click the Settings button and uncheck “Autocomplete Brackets”

Whether that qualifies as “easy” is a matter of opinion.