# emacs: Stop ctrl-n and ctrl-p falling back to the default bindings \(\#61140\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/002a5aba049f3a40a3eca5f45691baf147993528)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 002a5aba049f3a40a3eca5f45691baf147993528

Requested commit: 002a5aba049f3a40a3eca5f45691baf147993528

Commit: 002a5aba049f3a40a3eca5f45691baf147993528

Tree: 090f28e10b9a9b316fea5665aa362468804b1d3a

Author: Apoorva Verma

Committer: GitHub

## Message

````
emacs: Stop ctrl-n and ctrl-p falling back to the default bindings (#61140)

on linux with the emacs keymap, holding `ctrl-n` at the end of the
buffer opens a new file every press. `ctrl-p` at the top opens the file
finder.

the keymap already tries `"ctrl-n": null`, but `null` only breaks
resolution in a *user* keymap, so from a base keymap
`workspace::NewFile` still resolves. a targeted unbind works regardless
of source:

```json
"ctrl-p": ["zed::Unbind", "file_finder::Toggle"],
"ctrl-n": ["zed::Unbind", "workspace::NewFile"],
```

left the MoveDown/MoveUp propagation alone, it's load bearing (agent
panel uses it for up-to-edit-last-message). tests cover the fix plus the
narrower ctrl-n/ctrl-p bindings still winning, since the unbind only
targets the one action.

ctrl-g/ctrl-x in that block are still null and probably just as broken,
but ctrl-x is a prefix key so i left them.

Closes #45010.

Release Notes:

- Fixed `ctrl-n` opening a new file and `ctrl-p` opening the file finder
at the ends of a buffer when using the Emacs keymap on Linux
````

## Parents

- [6b594a43b0f61c80ee8977d43df93b92c944453c](https://git.cafe/gitcafe/zed/commit/6b594a43b0f61c80ee8977d43df93b92c944453c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/002a5aba049f3a40a3eca5f45691baf147993528?format=markdown)
