lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 9b21888 2/3: Record some useful vim technique


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 9b21888 2/3: Record some useful vim techniques
Date: Thu, 3 Dec 2020 09:21:10 -0500 (EST)

branch: master
commit 9b218886fcee93e957f6d5b749fab11b3f17cb09
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Record some useful vim techniques
---
 gwc/develop1.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gwc/develop1.txt b/gwc/develop1.txt
index d622819..4c5a79c 100644
--- a/gwc/develop1.txt
+++ b/gwc/develop1.txt
@@ -299,10 +299,23 @@ popd
 
 cd /opt/lmi/src/lmi
 
-  # Find long lines in vim
+  # Useful vim commands that are not readily remembered
+
+  # Find long lines
 
 /\%>80v.\+
 
+  # Change column 41 to a comma, for non-matching lines in a range
+  # ('|41' seems incompatible with '|' separator, so use 'cursor')
+
+:'<,'>g!/xyzzy/call cursor (0,41) | norm r,
+
+  # In a range, copy each matching line, appending "_term" to the copy
+
+:'<,'>g/^    ,/ copy . | s/^    ,[^ ]*/&_term
+
+  # All other...
+
   # Identify source files not encoded compatibly with UTF-8
 
 for z in *.?pp; (iconv -f UTF-8 -t UTF-8 $z &>/dev/null || echo $z)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]