vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 09261bdf047aaee40fb3fe627587cb7de4be5ce8
parent 4f1b12672ee0a27f20667819b92949dd14e182cc
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 28 Nov 2015 17:08:15 +0100

vis: implement = operator in terms of fmt(1)

Diffstat:
Mconfig.def.h | 1+
Mmain.c | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git 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 @@ -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",