(vimMode: boolean, overrides: KeymapOverrides)
| 264 | // cm-vim-default-keymap). Built behind a compartment and reconfigured on Vim |
| 265 | // toggle or keymap-override changes. |
| 266 | function buildEditorKeymap(vimMode: boolean, overrides: KeymapOverrides): Extension { |
| 267 | return keymap.of([ |
| 268 | { |
| 269 | key: 'Mod-f', |
| 270 | run: () => { |
| 271 | const state = useStore.getState() |
| 272 | if (state.vimMode) return false |
| 273 | state.setSearchOpen(true) |
| 274 | return true |
| 275 | } |
| 276 | }, |
| 277 | // Move the current line (or selection) up/down — reorders the markdown so |
| 278 | // it persists in the file. Listed before defaultKeymap so the configured |
| 279 | // binding wins; works in Vim normal/insert and non-Vim alike. |
| 280 | { key: toCmKey(getKeymapBinding(overrides, 'editor.moveLineUp')), run: moveLineUp }, |
| 281 | { key: toCmKey(getKeymapBinding(overrides, 'editor.moveLineDown')), run: moveLineDown }, |
| 282 | indentWithTab, |
| 283 | ...vimAwareDefaultKeymap(vimMode), |
| 284 | ...historyKeymap, |
| 285 | ...searchKeymap, |
| 286 | ...completionKeymap |
| 287 | ]) |
| 288 | } |
| 289 | |
| 290 | function markdownEditingExtensions(): Extension[] { |
| 291 | return [ |
no test coverage detected