react-codemirror
react-codemirror copied to clipboard
Disable autocompletion keymap
Trying to just outright disable the autocompletion on enter keymap, however, I am unable to, tried the following:
<CodeMirror value="print('hi!')" extensions={[python()]} basicSetup={{completionKeymap: false, defaultKeymap: false}}></CodeMirror>
But tab and enter still indent and autocomplete respectively with no change
@Bluebotlabz
import { EditorState, EditorView, keymap } from "@codemirror/core";
import { autocompletion } from "@codemirror/autocomplete";
// Create an autocompletion plugin
const autocompletionPlugin = autocompletion();
// Create an empty keymap to disable autocompletion
const disableAutocompleteKeymap = keymap.of([]);
<CodeMirror
// ...
extensions={[autocompletionPlugin, disableAutocompleteKeymap]}
/>