]> git.mdlowis.com Git - projs/tide.git/commitdiff
added functions to rc file for adding and removing line numbers as well as trimming...
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 1 Feb 2017 00:08:17 +0000 (19:08 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 1 Feb 2017 00:08:17 +0000 (19:08 -0500)
Makefile
TODO.md
editrc

index a5aef785bf66a3746a0b3ab3ded6d2ecd5213741..9f2f0a5b465ac77610b671b0cf158272218316de 100644 (file)
--- 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 d3ee0344e0bb787646b8ae54eddff48a0711ca52..7a20daaf725858b0ba54be35e4d4b0fd5049fee0 100644 (file)
--- 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 a984698a08bcbfd1d2f3a64a3c459d04bdbc73e3..4d76221c12ae9f757c0a9288cb1df5d5dd89fc70 100644 (file)
--- 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 ]\+$//'; }