@@ -1900,6 +1900,40 @@ mod cmd {
19001900 Ok(())
19011901 }
19021902
1903+ fn vsplit(
1904+ cx: &mut compositor::Context,
1905+ args: &[&str],
1906+ _event: PromptEvent,
1907+ ) -> anyhow::Result<()> {
1908+ let (_, doc) = current!(cx.editor);
1909+ let id = doc.id();
1910+
1911+ if let Some(path) = args.get(0) {
1912+ cx.editor.open(path.into(), Action::VerticalSplit)?;
1913+ } else {
1914+ cx.editor.switch(id, Action::VerticalSplit);
1915+ }
1916+
1917+ Ok(())
1918+ }
1919+
1920+ fn hsplit(
1921+ cx: &mut compositor::Context,
1922+ args: &[&str],
1923+ _event: PromptEvent,
1924+ ) -> anyhow::Result<()> {
1925+ let (_, doc) = current!(cx.editor);
1926+ let id = doc.id();
1927+
1928+ if let Some(path) = args.get(0) {
1929+ cx.editor.open(path.into(), Action::HorizontalSplit)?;
1930+ } else {
1931+ cx.editor.switch(id, Action::HorizontalSplit);
1932+ }
1933+
1934+ Ok(())
1935+ }
1936+
19031937 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
19041938 TypableCommand {
19051939 name: "quit",
@@ -2138,6 +2172,20 @@ mod cmd {
21382172 doc: "Display tree sitter scopes, primarily for theming and development.",
21392173 fun: tree_sitter_scopes,
21402174 completer: None,
2175+ },
2176+ TypableCommand {
2177+ name: "vsplit",
2178+ alias: Some("vsp"),
2179+ doc: "Open the file in a vertical split.",
2180+ fun: vsplit,
2181+ completer: Some(completers::filename),
2182+ },
2183+ TypableCommand {
2184+ name: "hsplit",
2185+ alias: Some("sp"),
2186+ doc: "Open the file in a horizontal split.",
2187+ fun: hsplit,
2188+ completer: Some(completers::filename),
21412189 }
21422190 ];
21432191