diff --git a/history.cpp b/history.cpp
index ff65c4542..2a367cd22 100644
--- a/history.cpp
+++ b/history.cpp
@@ -276,11 +276,11 @@ static void append_yaml_to_buffer(const wcstring &wcmd, time_t timestamp, const
 
     char timestamp_str[96];
     snprintf(timestamp_str, sizeof timestamp_str, "%ld", (long) timestamp);
-    buffer->append("   when: ", timestamp_str, "\n");
+    buffer->append("  when: ", timestamp_str, "\n");
 
     if (! required_paths.empty())
     {
-        buffer->append("   paths:\n");
+        buffer->append("  paths:\n");
 
         for (path_list_t::const_iterator iter = required_paths.begin(); iter != required_paths.end(); ++iter)
         {