diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-11-28 17:08:15 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-11-28 20:09:14 +0100 |
| commit | d6a2d5bea9364dfecefecef084671b2c7fc1dc8a (patch) | |
| tree | f17ccddfb1c35dbcb4a1f458dbd998c6e367aeed | |
| parent | de9fa14094e1a97769af014d4c23aabfab145d87 (diff) | |
| download | vis-d6a2d5bea9364dfecefecef084671b2c7fc1dc8a.tar.gz vis-d6a2d5bea9364dfecefecef084671b2c7fc1dc8a.tar.xz | |
vis: implement = operator in terms of fmt(1)
| -rw-r--r-- | config.def.h | 1 | ||||
| -rw-r--r-- | main.c | 6 |
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 */ }, }; @@ -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", |
