atom / autocomplete-plus

View and insert possible completions in the editor while typing
MIT License
960 stars 263 forks source link

Autocompletion is unwanted when editing plain text (txt, md, …) files #552

Open jancborchardt opened 9 years ago

jancborchardt commented 9 years ago

Similarly to https://github.com/atom/autocomplete-plus/issues/377 (»Disable default provider in comments / strings?«), the autocompletion should probably be disabled in plain text documents like txt or Markdown.

It’s pretty annoying when you’re typing something and you get suggestions for functions and stuff all the time even though you write an article for example.

benogle commented 9 years ago

You can use the fileBlacklist in the autocomplete plus settings to disable it in md and txt files.

It may not be unwanted for everyone.

jancborchardt commented 9 years ago

Yup, of course just suggesting something. It’s all about good defaults and I feel that maybe it’s a good default to put these filetypes in the fileBlacklist already. Thanks for the pointer to that in any case!

davemacdo commented 9 years ago

Sorry if this is a dumb question, but can anybody help me out with this? I'm relatively new to Atom. I've added the following lines to my config.cson and I'm still getting autocomplete suggestions in my .md files.

"autocomplete-plus":
  fileBlacklist: [
    "*.md"
  ]
jancborchardt commented 9 years ago

@davemacdo go to Settings -> Packages -> autocomplete-plus -> Settings -> File Blacklist and put in *.txt, *.md :)

davemacdo commented 9 years ago

(-‸ლ)

@jancborchardt Thanks.

ian-rose commented 8 years ago

I would love to be able to disable autocomplete in plain text files, however more often than not my plain text files are a new file (no filename to parse for an extension). I also encounter many unique file extensions that are plain text, so attempting to blacklist them all is a pain. Is there a way to blacklist by language rather than by extension? This would solve my problem perfectly as Atom assumes any unknown extension (including none) is plain text.

benogle commented 8 years ago

Is there a way to blacklist by language rather than by extension?

There is a Scope Blacklist setting. You can add .text.plain to that field to blacklist those without grammars.

calvinf commented 8 years ago

There's a minor formatting problem in the blacklist description due to the text being interpreted as markdown in the settings for the plugin.

https://github.com/atom/autocomplete-plus/blob/c75f47636f3af42da5339d0704e21f723d91fd72/package.json#L85

The source: Suggestions will not be provided for files matching this list, e.g. *.md for Markdown files. To blacklist more than one file extension, use comma as a separator, e.g. *.md, *.txt (both Markdown and text files).

But in the UI, the text between the first and second "" is being italicized and the "" are removed. This provides a bit of confusion as the editor will continue to autocomplete for markdown files if ".md" is entered and not "*.md".

lee-dohm commented 8 years ago

Thank you for the pointer @calvinf! Would you mind opening a new Issue for this?

calvinf commented 8 years ago

@lee-dohm will do. Opened #674.

azat-co commented 7 years ago

@benogle is there a way to blacklist only GFM text but leave autocomplete for code? In one file?

I couldn't find the right scope because .scope.gfm will blacklist everything.

d4rkd0s commented 6 years ago

I really really really need help with blacklisting... Atom 1.21.1 autocomplete-plus 2.35.11

Whenever I type ANYTHING this suggestion comes up:

image

No matter if I am writing javascript/python/php it tries to auto complete the <?php php open tag, its super annoying, I have tried a fresh install of Atom removing .atom and everything. I have tried disabling other plugins, its FOR SURE autocomplete-plus.

Can anyone help???

image

image

moustachedelait commented 6 years ago

How can I target new files that are unsaved and marked 'untitled' in the blacklist? I tried

*.md, *.txt, untitled, .text.plain

But new files still autocomplete

cefn commented 6 years ago

I strongly agree with the OP. I didn't choose to install autocomplete-plus, and given its installed by default from the minimal configuration I have, it has turns Atom from a usable text editor into a tool I have to combat.

Each design decision might seem to make sense individually, (adding a full language dictionary, running by default on all files, selecting single suggestion on Enter). However, the combined result is pretty horrific, meaning I have to permanently interact with the autocomplete navigation to type any words at all in the file I am currently editing. I'm making simple bulleted list in Markdown. Try it for yourself.

That's because when editing short lines of text (which I consider the killer app of a text editor) pressing happens every 20 characters or so when I complete a new bullet and almost universally replaces the last word of my text with something arbitrary. I can't agree that digging through the internet to find this package and setting to turn this behaviour off is a legitimate use of time for a new user of a text editor, and for many who might benefit from Atom it would simply be impossible to solve.

I recall giving up on Atom when I originally tested it because of behaviours like this, and I am only resuming testing because it is a standard IDE for pair programming with a prospective employer. Please consider disabling at least one of the elements in the default configuration, e.g.

Another workaround would be an alert box on load of a new file type which a) surfaces that autocomplete-plus is likely to interfere with your typing - which is otherwise hidden in the plumbing, b) offers a choice of behaviour, c) offers the means of making it permanent for the file type.

Of course the appearance of an alert box interferes with workflow, but not as badly as replacing every word you type without asking.