From 15152b4cfb108a1e1ba86555f63cde76ea2f21c3 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 2 Feb 2017 12:45:52 -0500 Subject: [PATCH] Tweaked some existing rc functions and added the term function to launch terminal in the current dir --- editrc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/editrc b/editrc index b99d680..b3686c2 100644 --- a/editrc +++ b/editrc @@ -3,9 +3,9 @@ # Tag Lines #------------------------------------------------------------------------------ -csrc(){ echo -n "Quit Save >lines |bc |uc {>Grep } Find "; } -src(){ echo -n "Quit Save >lines |bcmt |ucmt {>Grep } Find "; } -ptext(){ echo -n "Quit Save |fmt >words {>Grep } Find "; } +csrc(){ echo -n "Quit Save !term >lines |bc |uc {>Grep } Find "; } +src(){ echo -n "Quit Save !term >lines |bcmt |ucmt {>Grep } Find "; } +ptext(){ echo -n "Quit Save !term |fmt >words {>Grep } Find "; } # setup default tags line export EDITTAGS="$(csrc)" @@ -13,6 +13,9 @@ export EDITTAGS="$(csrc)" # Tool Functions #------------------------------------------------------------------------------ +# Launch a terminal emulator in the same dir as the editor +term(){ (nohup st)& } + # Regex search Grep(){ grep -n "$@"; } @@ -22,9 +25,9 @@ lines(){ wc -l; } # Block Comments for C and Scripting Languages bc(){ sed -e 's/^/\/\//'; } -uc(){ sed -e 's/^\/\///'; } +uc(){ sed -e 's/^\(\s*\)\/\//\1/'; } bcmt(){ sed -e 's/^/#/'; } -ucmt(){ sed -e 's/^#//'; } +ucmt(){ sed -e 's/^\(\s*\)#/\1/'; } # Expand tabs to spaces etabs(){ sed -e 's/\t/ /g'; } -- 2.51.0