summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-09 19:54:01 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-09 19:54:01 +0200
commitf8648c0312f1a9e8ad52b2f452b26137d299e293 (patch)
treef051ae9f246418ef9cde5d8f0279c8357351a188
parentd77980aab48c6023a88f9ba8f855a19a10bf0ade (diff)
downloadexrc-f8648c0312f1a9e8ad52b2f452b26137d299e293.tar.gz
Add formatting commands
-rw-r--r--vi.exrc17
1 files changed, 8 insertions, 9 deletions
diff --git a/vi.exrc b/vi.exrc
index 9d0f228..51a42c1 100644
--- a/vi.exrc
+++ b/vi.exrc
@@ -1,10 +1,13 @@
set para=IPLPPPQPP\ LIp\ q\ d\ l\ (l)l(\ )\ pplpipbp
set sect=NHSHH\ HUt\ h\ s\ hesesh
+" various mappings
map [ [[
map ] ]]
map < 1G
map > G
+map * {!}fmt }
+map K k$
" set mark like vim's visual mode
map V mv
@@ -22,17 +25,13 @@ map ; :.,'v
map :s///
"map i :s/// k:j l
-" search until line containing phrase
-map g/ /.*
-
-" edit "q buffer in new vi session
-map gQ m/:!echo > /tmp/vi.buf; vi /tmp/vi.buf :r /tmp/vi.buf "qdd`/
-map gq m/om("qpm):'(,')j :'(w! /tmp/vi.buf :'(d :!vi /tmp/vi.buf :r /tmp/vi.buf "qdd`/
-
" go to next/previous space
-map gw f
-map gb F
+map w f
+map b F
" go to next/previous troff command
map  /^[.'][^ ]*$
map  ?^[.'][^ ]*$
+
+" format C comment
+map * :?\/\*?+1,/\*\//-1s/ \*/ / :?\/\*?+1,/\*\//-1!fmt :?\/\*?+1,/\*\//-1s/ / */