Skip to content

Instantly share code, notes, and snippets.

perl -e 'print q/hello gist/;'
post by gist-vim (test)
" neobundle {{{
if has('vim_starting')
set runtimepath+=~/.bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.bundle/'))
" let NeoBundle manage NeoBundle
" required!
filetype off
filetype plugin indent off
let g:P= vital#of('vital').import('ProcessManager')
if !g:P.is_available()
throw 'omg'
endif
" ProcessManager intented to manage interactive processes,
" thus sort prg isn't good example.
let g:p= g:P.new('erl')
function! s:collect_imports()
return filter(getbufline('%', 1, '$'), 'v:val =~# "^\\s*import"')
endfunction
echo s:collect_imports()
let g:proc= vimproc#popen3('irb --simple-prompt')
sleep
echo 'kill()'
echo g:proc.kill(0)
call g:proc.stdin.write("warn 2;\n")
let g:stdout= ''
let g:proc= vimproc#popen3('irb --simple-prompt')
sleep
call g:proc.stdin.write("warn 2;\n")
let g:stdout= ''
let g:stderr= ''
while 1
let g:stdout.= g:proc.stdout.read()
" vim:foldmethod=marker:fen:
scriptencoding utf-8
set nocompatible
set runtimepath=~/.bundle/vimproc/
use 5.010;
use utf8;
use strict;
use warnings;
use Carp qw/croak cluck/;
use IPC::Open2;
use Time::HiRes qw/gettimeofday tv_interval/;
use Data::Dumper;
use Devel::Peek;
use Encode qw/decode/;
@kamichidu
kamichidu / vim-sprintf
Last active December 29, 2015 04:09
replace keyword
let s:save_cpo= &cpo
set cpo&vim
function! Sprintf(expr, args)
let l:result= a:expr
while match(l:result, '\${\w\+}') != -1
let l:keyword= matchstr(l:result, '\${\zs\w\+\ze}')
let l:replacement= has_key(a:args, l:keyword) ? a:args[l:keyword] : ''