Skip to content

Commit

Permalink
Fix issue where jj could not be entered in Vim mode (#347)
Browse files Browse the repository at this point in the history
* Fix issue where `jj` could not be entered in Vim mode

* Update Editor.tsx
  • Loading branch information
hackerwins authored Sep 13, 2024
1 parent c75c6af commit 03635fa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions frontend/src/components/editor/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { markdown } from "@codemirror/lang-markdown";
import { EditorState } from "@codemirror/state";
import { keymap } from "@codemirror/view";
import { Vim, vim } from "@replit/codemirror-vim";
import { vim } from "@replit/codemirror-vim";
import { basicSetup } from "@uiw/codemirror-extensions-basic-setup";
import { xcodeDark, xcodeLight } from "@uiw/codemirror-theme-xcode";
import { EditorView } from "codemirror";
Expand Down Expand Up @@ -94,9 +94,6 @@ function Editor(props: EditorProps) {
],
});

// Vim key mapping: Map 'jj' to '<Esc>' in insert mode
Vim.map("jj", "<Esc>", "insert");

const view = new EditorView({ state, parent: element });
dispatch(setCmView(view));

Expand Down

0 comments on commit 03635fa

Please sign in to comment.