about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-07 12:45:30 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-07 12:45:30 -0700
commit857ba192061823823b93675ea21739ffa3e09509 (patch)
treee5c5026910f083dd2db80f0bf2f5ed71202f6861
parent143b79b9e4eb91e53b104b3cbfc46b92cf4141bc (diff)
downloadmu-857ba192061823823b93675ea21739ffa3e09509.tar.gz
4672
-rw-r--r--vimrc.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/vimrc.vim b/vimrc.vim
index efaee6df..93a63f57 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -73,3 +73,11 @@ function! SubxPath(arg)
     return "apps/" . a:arg . "*.subx"
   endif
 endfunction
+
+" we often want to crib lines of machine code from other files
+function! GrepSubX(regex)
+  " https://github.com/mtth/scratch.vim
+  Scratch!
+  silent exec "r !grep -h ".shellescape(a:regex)." *.subx */*.subx"
+endfunction
+command! -nargs=1 G call GrepSubX(<args>)