aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h1
-rw-r--r--main.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 5296ce4..7e4d637 100644
--- a/config.def.h
+++ b/config.def.h
@@ -188,6 +188,7 @@ static KeyBinding vis_operators[] = {
{ "g~", ACTION(OPERATOR_CASE_SWAP) },
{ "gu", ACTION(OPERATOR_CASE_LOWER) },
{ "!", ACTION(OPERATOR_FILTER) },
+ { "=", ACTION(OPERATOR_FILTER_FMT) },
{ "\"", ACTION(REGISTER) },
{ /* empty last element, array terminator */ },
};
diff --git a/main.c b/main.c
index 70216df..f15882a 100644
--- a/main.c
+++ b/main.c
@@ -199,6 +199,7 @@ enum {
VIS_ACTION_OPERATOR_CASE_UPPER,
VIS_ACTION_OPERATOR_CASE_SWAP,
VIS_ACTION_OPERATOR_FILTER,
+ VIS_ACTION_OPERATOR_FILTER_FMT,
VIS_ACTION_COUNT,
VIS_ACTION_INSERT_NEWLINE,
VIS_ACTION_INSERT_TAB,
@@ -712,6 +713,11 @@ static KeyAction vis_action[] = {
"Filter operator",
operator_filter,
},
+ [VIS_ACTION_OPERATOR_FILTER_FMT] = {
+ "vis-operator-filter-format",
+ "Formating operator, filter range through fmt(1)",
+ operator_filter, { .s = "'<,'>!fmt" }
+ },
[VIS_ACTION_COUNT] = {
"vis-count",
"Count specifier",