Merge branch 'space-shell/helix-keybindings' of codeberg.org:space-shell/strudel into space-shell/helix-keybindings

This commit is contained in:
space-shell 2026-01-13 19:49:49 +01:00
commit 18cc1e4466
52 changed files with 3633 additions and 484 deletions

View file

@ -1,5 +1,5 @@
import { defaultKeymap } from '@codemirror/commands';
import { Prec } from '@codemirror/state';
import { Prec, EditorState } from '@codemirror/state';
import { keymap, ViewPlugin } from '@codemirror/view';
// import { searchKeymap } from '@codemirror/search';
import { emacs } from '@replit/codemirror-emacs';
@ -182,7 +182,13 @@ const keymaps = {
helix: () => [helix(), helixCommands],
};
export { Vim } from '@replit/codemirror-vim';
export function keybindings(name) {
const active = keymaps[name];
return [active ? Prec.high(active()) : []];
const extensions = active ? [Prec.high(active())] : [];
if (name === 'vim') {
extensions.push(EditorState.allowMultipleSelections.of(true));
}
return extensions;
}