From: Michael D. Lowis Date: Wed, 1 Feb 2017 00:08:17 +0000 (-0500) Subject: added functions to rc file for adding and removing line numbers as well as trimming... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=06bd66b4a8d3bf94ecb82f22e05056ae79ccf81b;p=projs%2Ftide.git added functions to rc file for adding and removing line numbers as well as trimming trailing whitespace --- diff --git a/Makefile b/Makefile index a5aef78..9f2f0a5 100644 --- a/Makefile +++ b/Makefile @@ -57,4 +57,5 @@ libedit.a: $(LIBEDIT_OBJS) unittests: $(TEST_OBJS) libedit.a --include *.d lib/*.d tests/*.d \ No newline at end of file +-include *.d lib/*.d tests/*.d + diff --git a/TODO.md b/TODO.md index d3ee034..7a20daa 100644 --- a/TODO.md +++ b/TODO.md @@ -23,7 +23,6 @@ The Rest: * shortcut to repeat previous operation * implement command diffing logic to optimize the undo/redo log - The Future: * Run commands in the background and don't block the main thread. diff --git a/editrc b/editrc index a984698..4d76221 100644 --- a/editrc +++ b/editrc @@ -27,3 +27,9 @@ ucmt(){ sed -e 's/^#//'; } # Expand tabs to spaces etabs(){ sed -e 's/\t/ /g'; } +# Add a line number to each line of the file +lnnum(){ sed -e = | sed -e 'N;s/\n/\t/'; } +nolnnum(){ sed -e 's/^[0-9]\+\t//'; } + +# Trim trailing whitspace +trim(){ sed -e 's/[\t ]\+$//'; }