about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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>)