An open API service indexing awesome lists of open source software.

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

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'
}
]
}
}
]
});
```