https://github.com/samdark/codemirror-autosuggest
CodeMirror autosuggest addon
https://github.com/samdark/codemirror-autosuggest
autocomplete autosuggest codemirror
Last synced: about 1 year ago
JSON representation
CodeMirror autosuggest addon
- Host: GitHub
- URL: https://github.com/samdark/codemirror-autosuggest
- Owner: samdark
- License: other
- Created: 2016-01-02T16:56:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-23T15:47:34.000Z (about 7 years ago)
- Last Synced: 2025-03-27T12:38:25.028Z (about 1 year ago)
- Topics: autocomplete, autosuggest, codemirror
- Language: JavaScript
- Size: 4.88 KB
- Stars: 47
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
CodeMirror autosuggest addon
============================
Triggers autocompletion when certain character is typed.

## Usage
Include scripts needed into webpage.
```html
```
Initialize CodeMirror specifying suggestions config as an array in `autoSuggest` config property.
```javascript
var editor = CodeMirror.fromTextArea(document.getElementById('text'), {
mode: 'gfm',
autoSuggest: [
{
mode: 'markdown',
startChar: '@',
listCallback: function() {
return [
{
text: 'cebe ',
displayText: 'cebe'
},
{
text: 'jacmoe ',
displayText: 'jacmoe'
},
{
text: 'samdark ',
displayText: 'samdark'
}
];
}
},
{
mode: 'markdown',
startChar: '#',
listCallback: function() {
return [
{
text: '#hash ',
displayText: 'hash'
}
]
}
}
]
});
```