Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable autocompletion keymap #630

Open
Bluebotlabz opened this issue Feb 9, 2024 · 1 comment
Open

Disable autocompletion keymap #630

Bluebotlabz opened this issue Feb 9, 2024 · 1 comment

Comments

@Bluebotlabz
Copy link

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

@jaywcjlove
Copy link
Member

@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]}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants