https://github.com/rencryptofish/codemirror-lang-vyper
CodeMirror 6 extension for Vyper language support and syntax highlighting
https://github.com/rencryptofish/codemirror-lang-vyper
Last synced: 5 months ago
JSON representation
CodeMirror 6 extension for Vyper language support and syntax highlighting
- Host: GitHub
- URL: https://github.com/rencryptofish/codemirror-lang-vyper
- Owner: rencryptofish
- License: mit
- Created: 2023-08-05T23:07:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T18:26:08.000Z (almost 3 years ago)
- Last Synced: 2025-11-16T22:18:40.658Z (8 months ago)
- Language: Vyper
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# codemirror-lang-vyper
A CodeMirror extension that provides Vyper syntax highlighting and language support. This is a work in progress.

## Usage
```ts
import { basicSetup } from 'codemirror';
import { EditorView, keymap } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { indentWithTab } from '@codemirror/commands';
import { vyper } from '../src';
// Fetch the content of example.vy
fetch('/example.vy')
.then(response => response.text())
.then(doc => {
new EditorView({
state: EditorState.create({
doc, // use the fetched content here
extensions: [
basicSetup,
keymap.of([indentWithTab]),
vyper,
],
}),
parent: document.querySelector('#editor'),
});
})
.catch(error => {
console.error("Error fetching the Vyper file:", error);
});
```