Skip to content
| Marketplace
Sign in
Visual Studio Code>Keymaps>Standard PageUp / PageDownNew to Visual Studio Code? Get it now.
Standard PageUp / PageDown

Standard PageUp / PageDown

Expression Inc.

|
1 install
| (0) | Free
PageUp/PageDown scroll by one page while keeping the cursor at the same position on the screen.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Standard PageUp / PageDown

日本語

Makes PageUp/PageDown scroll by one page while keeping the cursor at the same position on the screen (the same row from the top), like Visual Studio, Sublime Text, and JetBrains IDEs.

Rewritten from scratch based on the idea of russelldavis/vscode-better-pageup-pagedown by Russell Davis (MIT License). This is a modified version, not the original extension published by its author.

Behavior

Key Action
PageDown / PageUp Scroll by one page and move the cursor by the same number of lines
Shift+PageDown / Shift+PageUp Same movement, extending the selection
  • One page is the number of visible lines minus one. A partially visible bottom line becomes the top line of the next screen.
  • Near the end of the document: Scrolls only until the cursor lands exactly on the last line, so the on-screen position is kept. When it cannot scroll any further, the cursor moves to the last line.
  • Near the beginning of the document: Scrolls until the first line is at the top of the screen, keeping the cursor's on-screen position. When it cannot scroll any further, the cursor moves to the first line.
  • When the whole document fits on the screen, it does not scroll and moves the cursor to the first or last line.
  • When the cursor is off screen or the suggestion list is shown, VS Code's default behavior is used.
  • The cursor column and multiple cursors are handled the same way as VS Code's standard up/down movement (cursorMove).

Command names are shown in English or Japanese according to the VS Code display language.

Changes from the original extension

The original extension simply ran the standard "scroll one page" and "move cursor one page" commands in a row, so near the end or beginning of the document only the scrolling stopped and the cursor's on-screen position shifted. This version calculates the destination itself, decides the visible range, and then moves the cursor.

Limitations

Lines are counted as logical lines. Lines with a lot of word wrapping, or folded regions, may make the page size or on-screen position slightly off (the VS Code extension API does not provide the exact number of wrapped display lines).


日本語

PageUp/PageDown で、カーソルの画面上の位置(上から何行目か)を保ったまま 1 ページ分スクロールする拡張機能。Visual Studio、Sublime Text、JetBrains 系 IDE と同じ操作感になる。

Russell Davis 氏の russelldavis/vscode-better-pageup-pagedown(MIT License)の考え方をもとに、コードを一から書き直したもの。元の作者が公開している拡張そのものではなく、それを改変したバージョンである。

動作

キー 動作
PageDown / PageUp 1 ページ分スクロールし、カーソルも同じ行数だけ動かす
Shift+PageDown / Shift+PageUp 上と同じ移動で選択範囲を広げる
  • 1 ページは画面に見えている行数から 1 を引いた行数。一部だけ見えていた最下行が、次の画面の最上行になる。
  • 文書の末尾付近: カーソルがちょうど最終行に着くところまでだけスクロールするので、画面上の位置が保たれる。それ以上スクロールできないときは、カーソルを最終行へ動かす。
  • 文書の先頭付近: 先頭行が画面の最上行に来るところまでスクロールし、カーソルは画面上の位置を保つ。それ以上スクロールできないときは、カーソルを先頭行へ動かす。
  • 文書全体が画面に収まっているときはスクロールせず、カーソルを先頭行または最終行へ動かす。
  • カーソルが画面の外にあるときや、補完候補の一覧が出ているときは、VS Code 標準の動作になる。
  • カーソルの桁と複数カーソルは、VS Code 標準の上下移動(cursorMove)と同じように扱う。

コマンド名は、VS Code の表示言語に合わせて日本語か英語で表示する。

元の拡張からの変更点

元の拡張は「標準の 1 ページスクロール」と「標準の 1 ページカーソル移動」を続けて実行するだけだったため、文書の末尾や先頭付近ではスクロールだけが止まり、カーソルの画面上の位置がずれていた。この版は移動先を自分で計算し、表示位置を決めてからカーソルを動かす。

制限

行数の計算は論理行単位で行っている。そのため、折り返し表示が多い行や折りたたみがあると、1 ページの移動量や画面上の位置が少しずれることがある(VS Code の拡張 API からは、折り返し後の表示行数を正確に得られないため)。

開発

npm install                  # typescript と @types/vscode だけ
npm test                     # ビルドして移動先の計算のテストを実行(node:test)
npm run package              # .vsix を作成(vsce は npx でその都度取得)
npm run icon                 # images/icon.svg を images/icon.png(256×256)に書き出す(sharp-cli は npx でその都度取得)
npm run publish:marketplace  # VS Code Marketplace に公開(事前に vsce login ExpressionInc)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft