diff --git a/src/editor.c b/src/editor.c
index 052d6c7..74129c7 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -3912,7 +3912,7 @@ void editor_select_paragraph(GeanyEditor *editor)
 
 
 /* simple indentation to indent the current line with the same indent as the previous one */
-static void smart_line_indentation(GeanyEditor *editor, gint first_line, gint last_line)
+void editor_smart_indentation_for_lines(GeanyEditor *editor, gint first_line, gint last_line)
 {
 	gint i, sel_start = 0, sel_end = 0;
 
@@ -3964,12 +3964,12 @@ void editor_smart_line_indentation(GeanyEditor *editor, gint pos)
 
 	sci_start_undo_action(sci);
 
-	smart_line_indentation(editor, first_line, last_line);
+	editor_smart_indentation_for_lines(editor, first_line, last_line);
 
 	/* set cursor position if there was no selection */
 	if (first_sel_start == first_sel_end)
 	{
-		gint indent_pos = SSM(sci, SCI_GETLINEINDENTPOSITION, first_line, 0);
+		gint indent_pos = sci_get_indent_position(sci, first_line);
 
 		/* use indent position as user may wish to change indentation afterwards */
 		sci_set_current_position(sci, indent_pos, FALSE);
@@ -4008,7 +4008,7 @@ void editor_indentation_by_one_space(GeanyEditor *editor, gint pos, gboolean dec
 
 	for (i = first_line; i <= last_line; i++)
 	{
-		indentation_end = SSM(editor->sci, SCI_GETLINEINDENTPOSITION, i, 0);
+		indentation_end = sci_get_indent_position(editor->sci, i);
 		if (decrease)
 		{
 			line_start = SSM(editor->sci, SCI_POSITIONFROMLINE, i, 0);
diff --git a/src/editor.h b/src/editor.h
index 70b3c0e..871b12e 100644
--- a/src/editor.h
+++ b/src/editor.h
@@ -212,6 +212,8 @@ void editor_insert_alternative_whitespace(GeanyEditor *editor);
 
 void editor_indent(GeanyEditor *editor, gboolean increase);
 
+void editor_smart_indentation_for_lines(GeanyEditor *editor, gint first_line, gint last_line);
+
 void editor_smart_line_indentation(GeanyEditor *editor, gint pos);
 
 void editor_indentation_by_one_space(GeanyEditor *editor, gint pos, gboolean decrease);
diff --git a/src/keybindings.c b/src/keybindings.c
index 4e68723..4c487cd 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -371,6 +371,10 @@ static void init_default_kb(void)
 	keybindings_set_item(group, GEANY_KEYS_FORMAT_REFLOWPARAGRAPH, NULL,
 		GDK_j, GDK_CONTROL_MASK, "format_reflowparagraph", _("_Reflow Lines/Block"),
 		LW(reflow_lines_block1));
+	keybindings_set_item(group, GEANY_KEYS_FORMAT_INSERTLINE_AFTER, NULL,
+		0, 0, "format_insertline_after", _("Insert new line after current"), NULL);
+	keybindings_set_item(group, GEANY_KEYS_FORMAT_INSERTLINE_BEFORE, NULL,
+		0, 0, "format_insertline_before", _("Insert new line before current"), NULL);
 
 	group = ADD_KB_GROUP(INSERT, _("Insert"), cb_func_insert_action);
 
@@ -2402,6 +2406,56 @@ static void reflow_paragraph(GeanyEditor *editor)
 }
 
 
+static void insert_line_after(GeanyEditor *editor)
+{
+	ScintillaObject *sci = editor->sci;
+
+	gchar *eol;
+	gint line = sci_get_current_line(sci);
+
+	switch (sci_get_eol_mode(sci))
+	{
+		case SC_EOL_CRLF: eol = "\r\n"; break;
+		case SC_EOL_CR: eol = "\r"; break;
+		default: eol = "\n"; break;
+	}
+
+	sci_start_undo_action(sci);
+	sci_insert_text(sci, sci_get_line_end_position(sci, line), eol);
+	editor_smart_indentation_for_lines(editor, line+1, line+1);
+	sci_set_current_position(sci, sci_get_line_end_position(sci, line+1), TRUE);
+	sci_end_undo_action(sci);
+}
+
+
+static void insert_line_before(GeanyEditor *editor)
+{
+	ScintillaObject *sci = editor->sci;
+
+	gchar *eol;
+	gint line = sci_get_current_line(sci);
+	gint linestart = sci_get_position_from_line(sci, line);
+
+	gint indentpos = sci_get_indent_position(sci, line);
+	gchar *indentation = sci_get_contents_range(sci, linestart, indentpos);
+
+	switch (sci_get_eol_mode(sci))
+	{
+		case SC_EOL_CRLF: eol = "\r\n"; break;
+		case SC_EOL_CR: eol = "\r"; break;
+		default: eol = "\n"; break;
+	}
+
+	sci_start_undo_action(sci);
+	sci_insert_text(sci, linestart, eol);
+	sci_insert_text(sci, linestart, indentation);
+	sci_set_current_position(sci, indentpos, TRUE);
+	sci_end_undo_action(sci);
+
+	g_free(indentation);
+}
+
+
 /* common function for format keybindings, only valid when scintilla has focus. */
 static gboolean cb_func_format_action(guint key_id)
 {
@@ -2459,6 +2513,12 @@ static gboolean cb_func_format_action(guint key_id)
 		case GEANY_KEYS_FORMAT_REFLOWPARAGRAPH:
 			reflow_paragraph(doc->editor);
 			break;
+		case GEANY_KEYS_FORMAT_INSERTLINE_AFTER:
+			insert_line_after(doc->editor);
+			break;
+		case GEANY_KEYS_FORMAT_INSERTLINE_BEFORE:
+			insert_line_before(doc->editor);
+			break;
 	}
 	return TRUE;
 }
diff --git a/src/keybindings.h b/src/keybindings.h
index b876b61..b16d36f 100644
--- a/src/keybindings.h
+++ b/src/keybindings.h
@@ -191,6 +191,8 @@ enum GeanyKeysFormatID
 	GEANY_KEYS_FORMAT_SENDTOCMD3,				/**< Keybinding. */
 	GEANY_KEYS_FORMAT_SENDTOVTE,				/**< Keybinding. */
 	GEANY_KEYS_FORMAT_REFLOWPARAGRAPH,			/**< Keybinding. */
+	GEANY_KEYS_FORMAT_INSERTLINE_AFTER,			/**< Keybinding. */
+	GEANY_KEYS_FORMAT_INSERTLINE_BEFORE,			/**< Keybinding. */
 	GEANY_KEYS_FORMAT_COUNT
 };
 
@@ -370,4 +372,3 @@ void keybindings_show_shortcuts(void);
 const GeanyKeyBinding *keybindings_check_event(GdkEventKey *ev, gint *group_id, gint *binding_id);
 
 #endif
-
diff --git a/src/sciwrappers.c b/src/sciwrappers.c
index 5371590..c2dc6dc 100644
--- a/src/sciwrappers.c
+++ b/src/sciwrappers.c
@@ -1220,3 +1220,9 @@ gint sci_text_width(ScintillaObject *sci, gint styleNumber, const gchar *text)
 {
 	return SSM(sci, SCI_TEXTWIDTH, styleNumber, (sptr_t) text);
 }
+
+
+gint sci_get_indent_position(ScintillaObject *sci, gint line)
+{
+	return SSM(sci, SCI_GETLINEINDENTPOSITION, line, 0);
+}
diff --git a/src/sciwrappers.h b/src/sciwrappers.h
index 7aa4d2d..81bfc88 100644
--- a/src/sciwrappers.h
+++ b/src/sciwrappers.h
@@ -185,4 +185,6 @@ void				sci_lines_split				(ScintillaObject *sci, gint pixelWidth);
 void				sci_lines_join				(ScintillaObject *sci);
 gint				sci_text_width				(ScintillaObject *sci, gint styleNumber, const gchar *text);
 
+gint				sci_get_indent_position		(ScintillaObject *sci, gint line);
+
 #endif
