0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Emacs: キーバインド忘備録

0
Last updated at Posted at 2026-08-12

はじめに

VS CodeからEmacsへ移行しました。CodexとClaudeを利用して、RustやPythonでプログラムを作成しています。tmuxやherdrで作業する時間が増えましたので、VS Codeからターミナルベースのエディタに変更しました。

また、tmuxやherdrとのコンフリクトを避ける為、可能な限りemacsを優先してディフォルト設定を残します。

環境は、WSL2.0のUbuntu24.04ですので、Windowsアプリへのコピー&ペーストも可能としています。

今回の記事は、キーバインドを忘れてしまっているので、その忘備録です。

基本操作

ターミナル内での立ち上げ

emacs --daemon
emacsclient --nw 

プロセス確認と終了

pgrep -af '^emacs'
pkill -f '^emacs --daemon$'

特殊キーバインド

用途 キーバインド
M-x Esc $\rightarrow$ x

Emacsの終了

用途 キーバインド
終了 Ctrl + x $\rightarrow$ c

ファイル操作

用途 キーバインド
ファイルを開く Ctrl + x $\rightarrow$ Ctrl + f
ファイルを保存(同じ場所) Ctrl + x $\rightarrow$ Ctrl + s
ファイルを保存(違う場所) Ctrl +x $\rightarrow$ Ctrl + w

テキスト内移動

用途 キーバインド
前 Ctrl + f (forward)
後 Ctrl + b (backward)
次行 Ctrl + n (next)
前行 Ctrl + p (previous)

Emacs内のコピー&ペースト

用途 キーバインド
範囲の開始マーク Ctrl + space
範囲を設定 カーソルキー(又はCtrl+n 及びCtrl+p)
コピー Esc $\rightarrow$ w 
切取り Ctrl + w 
ペースト Ctrl + y

Windowsへのコピー&ペースト

用途 キーバインド
カット Ctrl+x
コピー Ctrl+c
ペースト Ctrl+v

コメント追加、削除

コピー&ペーストと同じ操作で範囲を設定して、以下のキーバインドを実行

用途 キーバインド
コメント追加・削除 Esc $\rightarrow$ ;

Bufferリスト操作(開いているファイル)

用途 キーバインド
Buffer表示 Ctrl + b
Buffer画面へ移動 Ctrl + x $\rightarrow$ o
Buffer選択 カーソルキー(又はCtrl+n 及びCtrl+p) $\rightarrow$ Return
選択Bufferの全表示 Ctrl + x $\rightarrow$ 1

設定ファイル(init.el)の再度読み込み

用途 キーバインド
読み込み M-x load-file $\rightarrow$ ~/.emacs.d/init.el
評価 init.elを開く $\rightarrow$ M-x eval-buffer
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?