Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #186 from atom-community/singleton-autocomplete-ma…
Browse files Browse the repository at this point in the history
…nager

Singleton AutocompleteManager, Separate View's Model From AutocompleteManager
  • Loading branch information
joefitzgerald committed Jan 28, 2015
2 parents f1ff321 + c3f1838 commit f2bebcf
Show file tree
Hide file tree
Showing 35 changed files with 2,207 additions and 1,029 deletions.
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,53 @@ View and insert possible completions in the editor while typing

![Autocomplete+](http://s14.directupload.net/images/140304/y7r7g5df.gif)

**Please note:** In the example above I have "Enable Auto Activation" enabled.
**Note:** In the example above, `Show Suggestions On Keystroke` is enabled.

![Enable auto activation setting](https://cloud.githubusercontent.com/assets/119684/3029677/fab41bb0-e037-11e3-85bf-a696996f2478.png)
![The Show Suggestions On Keystroke Setting](https://cloud.githubusercontent.com/assets/744740/5886909/a7071c2a-a372-11e4-9894-f12db4e8a1ae.png)

## Installation

You can install autocomplete+ using the Preferences pane.
* APM: `apm install autocomplete-plus`
* Preferences: Open Atom and go to `Preferences > Packages`, search for `autocomplete-plus`, and install it

## Plugins
## Providers

Also grab one of these awesome additions for autocomplete+:
`autocomplete+` has a powerful autocomplete provider API, allowing provider authors to add language-specific behavior to this package.

* [autocomplete-snippets](https://atom.io/packages/autocomplete-snippets)
* [autocomplete-paths](https://atom.io/packages/autocomplete-paths)
You should *definitely* install additional providers (the default provider bundled with this package is somewhat crude): https://github.com/atom-community/autocomplete-plus/wiki/Autocomplete-Providers

## Usage

Just type some stuff, and autocomplete+ will automatically show you some suggestions.
Press `UP` and `DOWN` to select another suggestion, press `TAB` to confirm your selection.
Additional confirmation keymapping can be customised in your keymap.cson:
Press `UP` and `DOWN` to select another suggestion, press `TAB` to confirm your selection. You can change the default keymap in `Preferences`:

* Keymap For Confirming A Suggestion
* Keymap For Navigating The Suggestion List

Additionally, the keymap can be customized in your keymap.cson:

```coffeescript
'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list':
'tab': 'unset!'
'enter': 'autocomplete-plus:confirm'
'up': 'unset!'
'down': 'unset!'
'ctrl-p': 'autocomplete-plus:select-previous'
'ctrl-n': 'autocomplete-plus:select-next'
```

## Features

* Shows autocompletion suggestions while typing
* Two modes: Live and delayed autocompletion (instant might slow down performance)
* Wordlist generation happens initially and on save (saves performance)
* Suggestions are calculated using `fuzzaldrin` (better results)
* File blacklisting
* Automatic wordlist expansion while typing
* Shows suggestions while typing
* Includes a default provider (`FuzzyProvider`):
* Wordlist generation happens when you open a file, while editing the file, and on save
* Suggestions are calculated using `fuzzaldrin`
* Exposes a provider API which can be used to extend the functionality of the package and provide targeted / contextually correct suggestions
* Disable autocomplete for file(s) via blacklisting
* Disable autocomplete for editor scope(s) via blacklisting

## Geeky Stuff: Adding Suggestion Providers
## Provider API

Since version 0.12.0, other packages are able to register suggestion providers to the autocomplete-plus package.
Great autocomplete depends on having great autocomplete providers. If there is not already a great provider for the language / grammar that you are working in, please consider creating a provider.

[See the tutorial on how to create and register suggestion providers](https://github.com/atom-community/autocomplete-plus/wiki/Tutorial:-Registering-and-creating-a-suggestion-provider)
[Read the `Provider API` documentation](https://github.com/atom-community/autocomplete-plus/wiki/Provider-API) to learn how to create a new autocomplete provider.
Loading

0 comments on commit f2bebcf

Please sign in to comment.