Skip to content

Commit 806d061

Browse files
author
y-yamasaki
committed
ブログ追加
1 parent 1d54ddf commit 806d061

File tree

10 files changed

+1186
-53
lines changed

10 files changed

+1186
-53
lines changed

WebSite/assets/data/blogList.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
[
2+
{
3+
"id": "blog_00024",
4+
"title": "Zed IDE keymap.jsonのすすめ",
5+
"date": "2025-12-26T00:00:00.000Z",
6+
"category": "IDE",
7+
"description": "Zedのkeymap.jsonの筆者の最低限のおすすめ設定を共有します",
8+
"tags": [
9+
"zed",
10+
"ai"
11+
],
12+
"thumbnail": "assets/img/zed_icon.png",
13+
"contentPath": "blog/blog_00024.html",
14+
"recommended": true
15+
},
216
{
317
"id": "blog_00019",
418
"title": "ブログのCSSにコードブロックにシンタックスハイライト付ける",

WebSite/assets/data/blogList_en.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
[
2+
{
3+
"id": "blog_00024",
4+
"title": "Recommended Zed `keymap.json` Settings",
5+
"date": "2025-12-26T00:00:00.000Z",
6+
"category": "IDE",
7+
"description": "I share my minimal recommended `keymap.json` settings for Zed.",
8+
"tags": [
9+
"zed",
10+
"ai"
11+
],
12+
"thumbnail": "assets/img/zed_icon.png",
13+
"contentPath": "blog/en/blog_00024.html",
14+
"recommended": true
15+
},
216
{
317
"id": "blog_00019",
418
"title": "Add Syntax Highlighting to Code Blocks in the Blog's CSS",
60.2 KB
Loading

WebSite/blog/blog_00019.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ <h2 id="まとめ">まとめ</h2><ul>
327327
</div>
328328
</div>
329329

330-
<div class="post-detail__nav post-detail__nav--bottom"><a href="blog_00022.html" class="btn btn--prev">← C#14の新機能の解説</a><a href="../blog.html" class="btn btn--back">← ブログ一覧へ戻る</a></div>
330+
<div class="post-detail__nav post-detail__nav--bottom"><a href="blog_00022.html" class="btn btn--prev">← C#14の新機能の解説</a><a href="../blog.html" class="btn btn--back">← ブログ一覧へ戻る</a><a href="blog_00024.html" class="btn btn--next">Zed IDE keyma… →</a></div>
331331
</article>
332332
</div>
333333
<aside class="post-sidebar">

WebSite/blog/blog_00024.html

Lines changed: 427 additions & 0 deletions
Large diffs are not rendered by default.

WebSite/blog/en/blog_00019.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ <h2 id="summary">Summary</h2><ul>
327327
</div>
328328
</div>
329329

330-
<div class="post-detail__nav post-detail__nav--bottom"><a href="blog_00022.html" class="btn btn--prev">← C#14:New Feat…</a><a href="../blog.html" class="btn btn--back">← Back to Blog</a></div>
330+
<div class="post-detail__nav post-detail__nav--bottom"><a href="blog_00022.html" class="btn btn--prev">← C#14:New Feat…</a><a href="../blog.html" class="btn btn--back">← Back to Blog</a><a href="blog_00024.html" class="btn btn--next">Recommended Z… →</a></div>
331331
</article>
332332
</div>
333333
<aside class="post-sidebar">

WebSite/blog/en/blog_00024.html

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: Recommended Zed `keymap.json` Settings
3+
date: 2025-12-26
4+
category: IDE
5+
description: I share my minimal recommended `keymap.json` settings for Zed.
6+
tags: [zed, ai]
7+
recommended: true
8+
thumbnail: assets/img/zed_icon.png
9+
---
10+
11+
Hello! Pan here.
12+
13+
In this post I describe my recommended `keymap.json` settings for the Zed editor — the key mappings I find convenient to set up.
14+
I also previously wrote about recommended IDE settings in `settings.json`, so you might want to read that as well:
15+
[!CARD](https://breadmotion.github.io/WebSite/blog/en/blog_00023.html)
16+
17+
## Introduction
18+
19+
Zed provides a customizable keybinding system that is easy to configure. While some IDEs let you change bindings via `settings.json`, Zed primarily uses `keymap.json` for most custom key mappings (writing them in `settings.json` may also work in some cases).
20+
21+
Examples of other editors/IDEs with configurable bindings:
22+
- VSCode
23+
- Atom
24+
- Emacs
25+
- JetBrains
26+
- Sublime Text
27+
- TextMate
28+
- Cursor
29+
30+
For the official documentation, see the Key Bindings section here:
31+
[!CARD](https://zed.dev/docs/key-bindings#contexts)
32+
33+
### How to configure
34+
35+
You can edit the keymap either by directly editing `keymap.json` or by opening the keymap editor via the command palette (`Ctrl-Shift-P`) and selecting `zed: open keymap`.
36+
The GUI-based keymap editor is convenient because it allows configuring bindings without knowing the exact JSON syntax.
37+
38+
| | `keymap.json` | Keymap editor |
39+
| :--- | :--- | :--- |
40+
| Characteristics | Allows fine-grained control | Configure without knowing the syntax |
41+
| Recommended for | People who prefer editing from the keyboard or want custom/advanced behaviors | People who want an easy, guided UI |
42+
43+
![image](../assets/img/blog_00024_0.png)
44+
45+
### Basic syntax
46+
47+
Keymap entries generally follow this structure. Zed supports sequences of multiple keys (entered in order), so within the `"bindings"` map you can represent multiple-key sequences by writing them with spaces (in the JSON representation you'll use `-` as part of the key token where required).
48+
49+
Example:
50+
51+
```json
52+
[
53+
{
54+
"bindings": {
55+
"ctrl-'": "command",
56+
"shift-ctrl-'": "command"
57+
}
58+
},
59+
{
60+
"context": "context",
61+
"bindings": {
62+
"fn-n": "command"
63+
}
64+
}
65+
]
66+
```
67+
68+
For more details on the syntax, refer to the `Keybinding Syntax` section in the official docs:
69+
https://zed.dev/docs/key-bindings#contexts
70+
71+
## My recommended settings
72+
73+
There are many details such as contexts, precedence, and remapping rules, but since this article focuses on practical recommendations, I'll list the minimal changes I suggest adding to your `keymap.json`.
74+
Note: I use an English-layout keyboard without a numeric keypad.
75+
76+
...
77+
78+
That said, my conclusion is that you should generally keep most bindings at their defaults. For the reasons explained later, you only need to add the following minimal entries to `keymap.json` — you generally don't need to touch the rest:
79+
80+
```json
81+
[
82+
{
83+
"context": "Editor",
84+
"bindings": {
85+
"ctrl-shift-'": "terminal_panel::Toggle" // default is "ctrl-`"
86+
}
87+
},
88+
{
89+
"context": "Panel",
90+
"bindings": {
91+
"ctrl-shift-]": "editor::ToggleFocus"
92+
}
93+
}
94+
]
95+
```
96+
97+
There are two reasons for this choice.
98+
99+
The above mappings addressed the most-needed operations for me that weren't available in the default keybindings. Adding these allows the following operations using only keyboard shortcuts:
100+
- Focus the agent panel at any time, so you can send prompts and interact with the AI chat without interrupting your workflow.
101+
- Focus the terminal panel at any time.
102+
- The default binding (`ctrl-b`) toggles the left sidebar. If you use the default right-docked layout for the agent and terminal panels, toggling the left sidebar twice while those panels are focused will return focus to the file editor — so you can always get back to editing quickly.
103+
104+
Most of the actions you need can be found and set via the command palette (`Ctrl-Shift-P`), and many users are already familiar with standard IDE/global keybindings. Zed also offers presets to make keybindings feel like other editors (e.g., VSCode-like), so making large, arbitrary changes is often unnecessary and may be counterproductive. Instead, follow this small process when you want a change:
105+
106+
1. Notice a single operation you want to simplify to a single keybinding.
107+
2. Search the command in the command palette or check the official documentation to see if the command exists.
108+
3. Assign the desired keybinding to that command.
109+
110+
You can use either the direct `keymap.json` edit or the keymap editor GUI for step 3.
111+
112+
## Conclusion
113+
114+
If you make sure navigation between panels is well-covered by your keymap, you can leave most shortcuts at their defaults and only remap the few keys that improve your workflow. Once you map the critical panel-navigation shortcuts, you should be able to work smoothly.
115+
116+
Enjoy a comfortable Zed experience!

WebSite/content/blog/blog_00024.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: Zed IDE keymap.jsonのすすめ
3+
date: 2025-12-26
4+
category: IDE
5+
description: Zedのkeymap.jsonの筆者の最低限のおすすめ設定を共有します
6+
tags: [zed, ai]
7+
recommended: true
8+
thumbnail: assets/img/zed_icon.png
9+
---
10+
11+
こんにちは!パン君です。
12+
13+
今回はZedエディタで設定しておくと便利な keymap.json について筆者のおすすめ設定を記述します。
14+
また前回の記事で IDEの設定ファイル settings.json についてのおすすめ設定も記述しておりますので、
15+
そちらも読んでみるといいかもしれません!
16+
[!CARD](https://breadmotion.github.io/WebSite/blog/blog_00023.html)
17+
18+
## はじめに
19+
20+
Zedにはカスタマイズが可能なキーバインドシステムがあり簡単に設定が可能です。
21+
また下記のようなIDEでは settins.json から設定を行うことができ、 Zed でもこれが可能ではありますが、
22+
Zedは keymap.json で基本は設定するようになっています。 (settings.jsonに書いても動作したはず)
23+
24+
- VSCode
25+
- Atom
26+
- Emacs
27+
- JetBrains
28+
- Sublime Text
29+
- TextMate
30+
- Cursor
31+
32+
また公式ドキュメントを参考にする場合は下記をみれば確実にわかります。
33+
[!CARD](https://zed.dev/docs/key-bindings#contexts)
34+
35+
### 設定方法
36+
37+
設定方法は keymap.jsonに直書きか、 [ctrl-shift-p] でコマンドパレットにて `zed: open keymap` を入力 & 選択 で設定が可能です。
38+
後者は GUIベースで設定が可能なのでかなり楽に設定が可能です
39+
40+
| | keymap.json | keymap editor |
41+
| :--- | :--- | :--- |
42+
| 特徴 | 細かいところまで手が届くかも? | 構文を知らなくても設定が可能 |
43+
| おすすめな人 | キーボードから手を離さずに調整したい人とか、特殊な挙動を作成したい人にはおすすめ | 構文がわからなかったり、簡単に設定したい人はおすすめ |
44+
45+
![image](../assets/img/blog_00024_0.png)
46+
47+
### 基本構文
48+
49+
基本的に下記の構文で記載していきます。
50+
単一のキー押下だけでなく、複数のキーを順番に入力するシーケンスも判定するように作られているので
51+
`"bindings"` マップ内の各キーは スペース(構文的には `-` で扱う必要がある) で複数キーの入力だと記述することで実現が可能です。
52+
53+
```json
54+
[
55+
{
56+
"bindings": {
57+
"ctrl-'": "command",
58+
"shift-ctrl-'": "command"
59+
}
60+
},
61+
{
62+
"context": "context",
63+
"bindings": {
64+
"fn-n": "command"
65+
}
66+
}
67+
]
68+
69+
```
70+
71+
他構文について細かく知りたい場合は下記公式ドキュメントの `Keybinding Syntax` の項の閲覧を推奨します。
72+
[!CARD](https://zed.dev/docs/key-bindings#contexts)
73+
74+
## 本題のおすすめ設定
75+
76+
コンテキスト や 優先順位、リマップなど他にも色々細かくあるのですが、
77+
**本題の設定のすすめ** がメインなので設定ファイルのおすすめを記述していきます。
78+
※筆者は英字配列でかつテンキーが無いキーボードデバイスを利用しています。
79+
80+
...
81+
82+
と言いたいところですが、実はほとんどはデフォルトのままにしておいた方がいいというのが結論になります。
83+
理由は後述するとして、下記だけ `keymap.json` に追加しておけば他は特に触る必要がないです。
84+
85+
```json
86+
[
87+
{
88+
"context": "Editor",
89+
"bindings": {
90+
"ctrl-shift-'": "terminal_panel::Toggle" // デフォルトは "ctrl-`"
91+
}
92+
},
93+
{
94+
"context": "Panel",
95+
"bindings": {
96+
"ctrl-shift-]": "editor::ToggleFocus"
97+
}
98+
}
99+
]
100+
```
101+
102+
理由について2点
103+
104+
上記は自分にとって Zed IDE を使う際に最も必要だった操作にも関わらず デフォルトキー操作には存在しなかった臭かったので設定しました。
105+
これを追加することによって下記の操作がキー操作のみで可能になります。
106+
- エージェントパネルにいつでもフォーカスができ、AIとチャットベースのやり取りを中断する事なくプロンプトを投げることが可能
107+
- ターミナルパネルにいつでもフォーカスできる
108+
- デフォルトのキーバインド [ctrl-b] によって左のパネルの表示、非表示を切り替えることが出来るので、
109+
エージェントパネルとターミナルパネルをデフォルトの右ドッキングにしている人はそれらのパネルにフォーカスされている時にこの切り替えを二回行うとファイル編集画面にフォーカスをいつでも戻すことが可能です。
110+
111+
基本はコマンドパレット(`ctrl-shift-p`)で設定されているものは、従来皆さんが慣れ親しんでいるIDEやグローバルなキーバインドが設定されているます。
112+
かつ「~風」のキーバインドの設定をデフォルトにしてください! 的な設定項目もあるので、変に変更を加えたり、その人の感覚にあったキーバインドをおすすめしても意味がないです。
113+
なので、必要になったら下記の手順を取って各々追加、リマップしてください。
114+
115+
1. 「ここキー操作単体で簡潔させたいな」 という不満を抱く
116+
2. 該当操作が存在するか コマンドパレットで検索 もしくは 公式なりで調べる
117+
3. 該当するコマンドを自分が操作したいキーバインドで設定する
118+
119+
3に関しては前述した設定方法のどちらのアプローチでも大丈夫です。
120+
121+
## まとめ
122+
123+
パネル間の移動だけ完備してしまえば、後はデフォルトのショートカットを眺めた後に自分のキーマップにリマップしてしまえば
124+
なんでも思うように作業ができるようになるはずです。
125+
126+
それでは快適なZedライフを!

0 commit comments

Comments
 (0)