Communitygithub.com

24kchengYe/vscode-mpe-fixed-layout

Codex skill to keep VS Code Markdown Preview Enhanced in a locked left-narrow/right-wide layout

vscode-mpe-fixed-layout とは?

vscode-mpe-fixed-layout is a Codex agent skill that codex skill to keep VS Code Markdown Preview Enhanced in a locked left-narrow/right-wide layout.

対応~Claude CodeCodex CLI~Cursor
npx skills add 24kchengYe/vscode-mpe-fixed-layout

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

VS Code Markdown Preview Enhanced fixed layout

Install an idempotent local patch for Markdown Preview Enhanced 0.8.30 plus a small VS Code UI switcher. Preserve one Webview across folders; on every Markdown switch, lock the preview group, return the source to the first group, read codexMarkdownPreview.layout, restore a 28%/72% source-to-preview layout, and ignore repair-generated focus events so files cannot enter a switching loop. Horizontal places source left and preview right; vertical places source above and preview below.

Workflow

  1. Confirm VS Code and shd101wyy.markdown-preview-enhanced are installed.
  2. Choose and apply a layout:
    • Left/right: python3 scripts/apply_fix.py --layout horizontal
    • Top/bottom: python3 scripts/apply_fix.py --layout vertical
  3. Reload the VS Code window. Do not merely disable scroll synchronization.
  4. Open a Markdown source file and invoke Markdown Preview Enhanced once. The script installs these UI controls unless --skip-ui is passed:
    • Click the bottom status-bar button MD:左右 or MD:上下 to toggle immediately.
    • Or open the Command Palette (⌘⇧P) and run Markdown:切换左右/上下预览布局, Markdown:使用左右预览布局, or Markdown:使用上下预览布局.
  5. Test the failure path: focus or close the right preview, then click another Markdown file. Verify that:
    • the source opens in the first group (left or top);
    • the second preview (right or bottom) updates automatically;
    • the preview group shows a lock icon;
    • the source remains at 28% and the preview remains at 72%.

The lock icon means the preview group is already locked. Do not click it; clicking it explicitly unlocks the group.

Safety and compatibility

  • The script backs up both modified files once and is safe to run repeatedly.
  • The UI switcher saves the selected direction globally; later Markdown switches read that setting instead of reverting to a hard-coded direction.
  • Refuse to patch if any code anchor differs; do not guess against a newer bundle.
  • The code anchors are validated for Markdown Preview Enhanced 0.8.30. For another version, inspect its initPreview implementation and update the script deliberately.
  • An extension update or reinstall can overwrite the bundle. Run the skill again after updating.
  • Never install or retain a layout-reset helper extension that calls closeEditorsInGroup or evenEditorWidths on startup.

For another machine, clone or copy this skill folder into ${CODEX_HOME:-$HOME/.codex}/skills/vscode-mpe-fixed-layout, then invoke $vscode-mpe-fixed-layout or run its script directly.

関連スキル