buffer-bind-key(2)buffer-bind-key - Create local key binding for current buffer
buffer-unbind-key - Remove local key binding for current buffer
n buffer-bind-key "command" "key"
n buffer-unbind-key "key"
buffer-bind-key creates a key binding local to the current buffer, binding the command command to the keyboard input key. This command is particularly useful in conjunction with major-mode file hook (see major-mode(2)) allowing local key bindings dependent upon the context of the buffer.
The message line input is not effected by the current buffers local bindings.
buffer-unbind-key unbinds a user created local key binding, this command effects only the current buffer. If a negative argument is given to buffer-unbind-key then all the current buffer's bindings are removed.
The prefix commands cannot be rebound with this command.
Key response time linearly increases with each local binding added.
Ref: buffer-bind-key(2) File: m2cmd084.2 Date: 2026/01/17
(c) Copyright JASSPA 2026