From: Michael D. Lowis Date: Wed, 31 May 2017 13:01:56 +0000 (-0400) Subject: Rename xpick to just pick X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6e2c23b2c3c41af4b323e3564bc3562eb5e5df7b;p=projs%2Ftide.git Rename xpick to just pick --- diff --git a/.gitignore b/.gitignore index fa9f81c..bec87bb 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ term xcpd tests/tide tide +pick +tests/pick diff --git a/Makefile b/Makefile index c95ac5d..0629d3b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ INCS = -Iinc/ -BINS = tide xpick xcpd term -MAN1 = docs/tide.1 docs/xpick.1 docs/xtagpick.1 docs/xfilepick.1 +BINS = tide pick xcpd term +MAN1 = docs/tide.1 docs/pick.1 docs/xtagpick.1 docs/xfilepick.1 LIBEDIT_OBJS = \ lib/buf.o \ @@ -15,7 +15,7 @@ LIBEDIT_OBJS = \ TEST_BINS = \ tests/tide \ - tests/xpick \ + tests/pick \ tests/term \ tests/libedit @@ -30,20 +30,20 @@ docs: clean: find . -name '*.[oad]' -delete - $(RM) xpick tide xcpd term tests/libedit + $(RM) pick tide xcpd term tests/libedit $(RM) $(TEST_BINS) install: all mkdir -p $(PREFIX)/bin cp -f tide $(PREFIX)/bin - cp -f xpick $(PREFIX)/bin + cp -f pick $(PREFIX)/bin cp -f xcpd $(PREFIX)/bin cp -f xfilepick $(PREFIX)/bin cp -f xtagpick $(PREFIX)/bin uninstall: rm -f $(PREFIX)/bin/tide - rm -f $(PREFIX)/bin/xpick + rm -f $(PREFIX)/bin/pick rm -f $(PREFIX)/bin/xcpd rm -f $(PREFIX)/bin/xfilepick rm -f $(PREFIX)/bin/xtagpick @@ -55,12 +55,12 @@ libedit.a: $(LIBEDIT_OBJS) $(AR) $(ARFLAGS) $@ $^ tide: tide.o libedit.a -xpick: xpick.o libedit.a +pick: pick.o libedit.a xcpd: xcpd.o libedit.a term: term.o libedit.a tests/libedit: tests/libedit.o tests/lib/buf.o tests/lib/utf8.o libedit.a tests/tide: tests/tide.o libedit.a -tests/xpick: tests/xpick.o libedit.a +tests/pick: tests/pick.o libedit.a tests/term: tests/term.o libedit.a # define implicit rule for building binaries diff --git a/TODO.md b/TODO.md index 0cd149b..cab8f26 100644 --- a/TODO.md +++ b/TODO.md @@ -26,6 +26,12 @@ The Future: * implement command diffing logic to optimize the undo/redo log * Status line should omit characters from beginning of path to make file path fit +Possible Shortcuts: + +* Ctrl+{,} - Move to start or end brace of block +* Ctrl+(,) - Move to start or end of paragraph +* Ctrl+' - Move to matching brace, bracket, or paren + Maybe think about addressing these later: * Shift+Insert should insert primary selection diff --git a/docs/pick.1 b/docs/pick.1 new file mode 100644 index 0000000..4c0119f --- /dev/null +++ b/docs/pick.1 @@ -0,0 +1,28 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PICK" "1" "May 2017" "" "" +. +.SH "NAME" +\fBpick\fR \- fuzzy find an item from a list of items +. +.SH "SYNOPSIS" +\fBpick\fR [\fIquery\fR] +. +.SH "DESCRIPTION" +\fBpick\fR Takes a list of items on standard input delimited by newlines and an optional initial \fIquery\fR\. A gui window is then presented to the user which allows the user to filter the list using a fuzzy\-find algorithm\. The user\'s selection is printed to standard output upon completion\. If no option is selected \fBpick\fR exits with no output\. +. +.SS "Fuzzy\-Find Algorithm" +TODO: Document this +. +.SH "ENVIRONMENT" +. +.TP +\fBXPICKTITLE\fR +If this variable is set its contents are used to populate the status region of the \fBpick\fR window\. +. +.SH "AUTHOR" +Michael D\. Lowis +. +.SH "SEE ALSO" +tide(1) pick(1) xfilepick(1) xtagpick(1) diff --git a/docs/xpick.1.md b/docs/pick.1.md similarity index 64% rename from docs/xpick.1.md rename to docs/pick.1.md index 3395814..81757f1 100644 --- a/docs/xpick.1.md +++ b/docs/pick.1.md @@ -1,16 +1,16 @@ -# xpick -- fuzzy find an item from a list of items +# pick -- fuzzy find an item from a list of items ## SYNOPSIS -`xpick` [_query_] +`pick` [_query_] ## DESCRIPTION -`xpick` Takes a list of items on standard input delimited by newlines and an +`pick` Takes a list of items on standard input delimited by newlines and an optional initial _query_. A gui window is then presented to the user which allows the user to filter the list using a fuzzy-find algorithm. The user's selection is printed to standard output upon completion. If no option is -selected `xpick` exits with no output. +selected `pick` exits with no output. ### Fuzzy-Find Algorithm @@ -20,7 +20,7 @@ TODO: Document this * `XPICKTITLE`: If this variable is set its contents are used to populate the status region - of the `xpick` window. + of the `pick` window. ## AUTHOR @@ -28,4 +28,4 @@ Michael D. Lowis ## SEE ALSO -tide(1) xpick(1) xfilepick(1) xtagpick(1) +tide(1) pick(1) xfilepick(1) xtagpick(1) diff --git a/docs/tide.1 b/docs/tide.1 index 52abdcc..8fb6da6 100644 --- a/docs/tide.1 +++ b/docs/tide.1 @@ -374,4 +374,4 @@ The contents of this variable are used as the shell in which all non\-builtin co Michael D\. Lowis . .SH "SEE ALSO" -tide(1) xpick(1) xfilepick(1) xtagpick(1) +tide(1) pick(1) xfilepick(1) xtagpick(1) diff --git a/docs/tide.1.md b/docs/tide.1.md index 6e33033..21dd9bb 100644 --- a/docs/tide.1.md +++ b/docs/tide.1.md @@ -402,4 +402,4 @@ Michael D. Lowis ## SEE ALSO -tide(1) xpick(1) xfilepick(1) xtagpick(1) +tide(1) pick(1) xfilepick(1) xtagpick(1) diff --git a/docs/xpick.1 b/docs/xpick.1 deleted file mode 100644 index 762c728..0000000 --- a/docs/xpick.1 +++ /dev/null @@ -1,28 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "XPICK" "1" "May 2017" "" "" -. -.SH "NAME" -\fBxpick\fR \- fuzzy find an item from a list of items -. -.SH "SYNOPSIS" -\fBxpick\fR [\fIquery\fR] -. -.SH "DESCRIPTION" -\fBxpick\fR Takes a list of items on standard input delimited by newlines and an optional initial \fIquery\fR\. A gui window is then presented to the user which allows the user to filter the list using a fuzzy\-find algorithm\. The user\'s selection is printed to standard output upon completion\. If no option is selected \fBxpick\fR exits with no output\. -. -.SS "Fuzzy\-Find Algorithm" -TODO: Document this -. -.SH "ENVIRONMENT" -. -.TP -\fBXPICKTITLE\fR -If this variable is set its contents are used to populate the status region of the \fBxpick\fR window\. -. -.SH "AUTHOR" -Michael D\. Lowis -. -.SH "SEE ALSO" -tide(1) xpick(1) xfilepick(1) xtagpick(1) diff --git a/docs/xtagpick.1 b/docs/xtagpick.1 index 5377e2d..f20736a 100644 --- a/docs/xtagpick.1 +++ b/docs/xtagpick.1 @@ -4,7 +4,7 @@ .TH "XTAGPICK" "1" "May 2017" "" "" . .SH "NAME" -\fBxtagpick\fR \- Parses a ctags file and sends results to xpick +\fBxtagpick\fR \- Parses a ctags file and sends results to pick(1) . .SH "SYNOPSIS" . diff --git a/docs/xtagpick.1.md b/docs/xtagpick.1.md index 55b1085..b5c5e8e 100644 --- a/docs/xtagpick.1.md +++ b/docs/xtagpick.1.md @@ -1,4 +1,4 @@ -# xtagpick -- Parses a ctags file and sends results to xpick +# xtagpick -- Parses a ctags file and sends results to pick(1) ## SYNOPSIS ## DESCRIPTION ## OPTIONS diff --git a/xpick.c b/pick.c similarity index 98% rename from xpick.c rename to pick.c index d7134bb..58afbdc 100644 --- a/xpick.c +++ b/pick.c @@ -226,9 +226,9 @@ int main(int argc, char** argv) { char* title = getenv("XPICKTITLE"); load_choices(); if (vec_size(&Choices) > 1) { - win_dialog("xpick", onerror); + win_dialog("pick", onerror); win_setkeys(Bindings); - win_settext(STATUS, (title ? title : "xpick")); + win_settext(STATUS, (title ? title : "pick")); if (argc >= 2) { for (char* str = argv[1]; *str; str++) buf_insert(win_buf(TAGS), false, Pos++, *str); diff --git a/tests/xpick.c b/tests/pick.c similarity index 73% rename from tests/xpick.c rename to tests/pick.c index 82adc25..9e787de 100644 --- a/tests/xpick.c +++ b/tests/pick.c @@ -2,8 +2,8 @@ #include #include -// Inculd the source file so we can access everything -#include "../xpick.c" +// Inculd the source file so we can access everything +#include "../pick.c" TEST_SUITE(UnitTests) { } diff --git a/xfilepick b/xfilepick index 6ba9c66..a890643 100755 --- a/xfilepick +++ b/xfilepick @@ -5,4 +5,4 @@ if [ "$#" -ne 1 ]; then fi export XPICKTITLE="Pick File ($PWD)" -find $1 -not -path '*/\.*' -type f | sed "s|^\./||" | xpick +find $1 -not -path '*/\.*' -type f | sed "s|^\./||" | pick diff --git a/xtagpick b/xtagpick index d4027ee..20f7ab2 100755 --- a/xtagpick +++ b/xtagpick @@ -21,12 +21,12 @@ printtags(){ } print(){ - printtags | xpick "$TAG" + printtags | pick "$TAG" } fetch(){ if [ "" == "$TAG" ]; then - TAG=$(printtags | xpick) + TAG=$(printtags | pick) [ "" == "$TAG" ] && exit fi awk -v TAG="$TAG" ' @@ -38,7 +38,7 @@ fetch(){ gsub(/\*/, "\\*", matchstr) print "grep -Hn", matchstr, $2, "| cut -d: -f1,2" } - ' "$TAGFILE" | /bin/sh | xpick + ' "$TAGFILE" | /bin/sh | pick } export XPICKTITLE="Pick CTag ($PWD)"