~kaction/config

ref: 1ab4be43ae3f278dc70cd8da11c4a06c69414dda config/aux/vim-snipcmd -rwxr-xr-x 441 bytes
1ab4be43 — Dmitry Bogatov nix: import old patch for rc shell 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh -eu
cat << 'EOF'
function! s:template(name, ...)
  let command = "read!~/.vim/bin/" . a:name
  for ix in range(0, len(a:000) - 1)
    let command .= " " . shellescape(a:000[ix])
  endfor
  normal mT
  execute command
  normal 'T
endfunction
EOF

for base ; do
  printf                                                             \
    "command! -nargs=* I%s silent call s:template('%s', <f-args>)\n" \
    "${base}" "${base}"
done