From f8648c0312f1a9e8ad52b2f452b26137d299e293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 9 Jul 2021 19:54:01 +0200 Subject: Add formatting commands --- vi.exrc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'vi.exrc') 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/ / */ -- cgit v1.2.3