From 324d7c615ee30c616af731b9b5dbdb942ffa2b02 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 28 Jul 2017 23:44:46 -0400 Subject: Add toggle to hnel --- curtis/.bin/hnel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'curtis') diff --git a/curtis/.bin/hnel.c b/curtis/.bin/hnel.c index bb087df1..981355a6 100755 --- a/curtis/.bin/hnel.c +++ b/curtis/.bin/hnel.c @@ -6,6 +6,7 @@ exec cc -Wall -Wextra -pedantic $@ -lutil -o $(dirname $0)/hnel $0 #include #include +#include #include #include #include @@ -41,6 +42,7 @@ int main(int argc, char *argv[]) { if (argc < 2) return EX_USAGE; + bool enable = true; char table[256] = {0}; table['n'] = 'j'; table['N'] = 'J'; table[CTRL('N')] = CTRL('J'); table['e'] = 'k'; table['E'] = 'K'; table[CTRL('E')] = CTRL('K'); @@ -82,8 +84,13 @@ int main(int argc, char *argv[]) { if (len < 0) err(EX_IOERR, "read(%d)", STDIN_FILENO); if (len == 1) { + if (buf[0] == CTRL('S')) { + enable = !enable; + continue; + } + unsigned char c = buf[0]; - if (table[c]) buf[0] = table[c]; + if (enable && table[c]) buf[0] = table[c]; } len = writeAll(master, buf, len); -- cgit 1.4.1 t type='hidden' name='id' value='4473cafa506c6cfab74f43238476afe5aaceaa28'/>
path: root/bin (unfollow)
Commit message (Expand)Author
2019-02-09Combine all Keyword patternsJune McEnroe
2019-02-09Run hi -c after compiling hiJune McEnroe
2019-02-09Fix IRC output monospace option to emit once per lineJune McEnroe
2019-02-09Add output format options to hiJune McEnroe
2019-02-09Avoid using SGRReset and IRCResetJune McEnroe
2019-02-08Use X macros for hi classesJune McEnroe
2019-02-08Don't open folds when using {}June McEnroe
2019-02-08Add sh syntax to hiJune McEnroe
2019-02-08Use [] to quote special characters in regexJune McEnroe
2019-02-08Improve ANSI output and base IRC on itJune McEnroe
2019-02-08Add hi -nJune McEnroe
2019-02-08Elaborate hi man pageJune McEnroe
2019-02-08Use set for parent in hiJune McEnroe
2019-02-08Switch back to semantic keyword grouping in hiJune McEnroe
2019-02-08Match only the basename in hiJune McEnroe
2019-02-07Add mdoc syntax to hiJune McEnroe
2019-02-07Support multi-line C macros in hiJune McEnroe
2019-02-07Detect .mk files as makeJune McEnroe
2019-02-07Add make syntax to hiJune McEnroe
2019-02-07Add IRC output to hiJune McEnroe
2019-02-07Improve C syntax accuracy and add Format classJune McEnroe
2019-02-07Factor out hi checkJune McEnroe
2019-02-07Add Escape class to hiJune McEnroe
2019-02-07Add Todo class and parent syntax constraintJune McEnroe