summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-10-30 08:45:47 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-10-30 08:45:47 +0000
commitcc01aab8b889b4cef9455e4f83b74e28f84f30a9 (patch)
treeef57d094d91ec4550e6532417fac99b31225f9f5 /src/normal.cc
parentdc1fbcdaa21ea14fa0a809b33893e58156e6f1e8 (diff)
add <a-gt> for indenting even empty lines
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 00474544..2ff1e0b0 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -559,6 +559,7 @@ void keep(Context& context, int)
});
}
+template<bool indent_empty = false>
void indent(Context& context, int)
{
CharCount indent_width = context.options()["indentwidth"].get<int>();
@@ -571,7 +572,7 @@ void indent(Context& context, int)
SelectionList res;
for (auto line = sel.min().line; line < sel.max().line+1; ++line)
{
- if (buf[line].length() > 1)
+ if (indent_empty or buf[line].length() > 1)
res.emplace_back(line, line);
}
return res;
@@ -996,6 +997,7 @@ KeyMap keymap =
{ '<', deindent },
{ '>', indent },
+ { alt('>'), indent<true> },
{ ctrl('i'), jump<Forward> },
{ ctrl('o'), jump<Backward> },