summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-17 15:07:55 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-17 15:07:55 +0200
commit0a15bce060bda3c60d0cf521c6f213e35bf85175 (patch)
treee67106a0bf9fbb2192bacfae1433469b674d7f8d
parent5304018d0b1559b33c2effb3beaafe54df197455 (diff)
downloadexrc-0a15bce060bda3c60d0cf521c6f213e35bf85175.tar.gz
vi.exrc: Add g/, gq and gQ commands
-rw-r--r--vi.exrc14
1 files changed, 13 insertions, 1 deletions
diff --git a/vi.exrc b/vi.exrc
index dce098e..3f69462 100644
--- a/vi.exrc
+++ b/vi.exrc
@@ -1,10 +1,22 @@
-" set mark like visual mode
+" set mark like vim's visual line mode
map V mv
+
" jump to other end of "selection"
map v `v``mv``
+
" operate on forward "selection"
map : :'v,.
+
" operate on backward "selection"
map ; :.,'v
+
" delete searched phrase
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`/