@@ -172,6 +172,24 @@ fn force_buffer_close_all(
172172 buffer_close_by_ids_impl(cx.editor, &document_ids, true)
173173}
174174
175+fn buffer_next(
176+ cx: &mut compositor::Context,
177+ _args: &[Cow<str>],
178+ _event: PromptEvent,
179+) -> anyhow::Result<()> {
180+ goto_buffer(cx.editor, Direction::Forward);
181+ Ok(())
182+}
183+
184+fn buffer_previous(
185+ cx: &mut compositor::Context,
186+ _args: &[Cow<str>],
187+ _event: PromptEvent,
188+) -> anyhow::Result<()> {
189+ goto_buffer(cx.editor, Direction::Backward);
190+ Ok(())
191+}
192+
175193fn write_impl(cx: &mut compositor::Context, path: Option<&Cow<str>>) -> anyhow::Result<()> {
176194 let jobs = &mut cx.jobs;
177195 let doc = doc_mut!(cx.editor);
@@ -1082,6 +1100,20 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
10821100 fun: force_buffer_close_all,
10831101 completer: None,
10841102 },
1103+ TypableCommand {
1104+ name: "buffer-next",
1105+ aliases: &["bn", "bnext"],
1106+ doc: "Go to next buffer.",
1107+ fun: buffer_next,
1108+ completer: None,
1109+ },
1110+ TypableCommand {
1111+ name: "buffer-previous",
1112+ aliases: &["bp", "bprev"],
1113+ doc: "Go to previous buffer.",
1114+ fun: buffer_previous,
1115+ completer: None,
1116+ },
10851117 TypableCommand {
10861118 name: "write",
10871119 aliases: &["w"],