Skip to content

Instantly share code, notes, and snippets.

local prototype= require 'prototype'
-- stack (helper module) {{{
local stack= prototype {
default= prototype.assignment_copy,
table= prototype.deep_copy,
}
stack.elements= {}
function! s:sync(pm)
let [out, err, stat]= a:pm.read('ji', [' > '])
while stat !=# 'matched'
let [out, err, stat]= a:pm.read('ji', [' > '])
endwhile
return out
endfunction
let s:native2ascii= {}
function! s:native2ascii.encode(s)
" `s' is &encoding
let chars= split(a:s, '\zs')
let length= len(chars)
let buf= []
let i= 0
while i < length
---
classes:
- name: 'java.util.List'
interfaces: ['java.util.Collection', 'java.lang.Iterable']
superclass: 'java.util.Collection'
comment_text: ''
since: '1.2'
see:
- 'java.util.Collection'
- 'java.util.Set'
let endpatterns= ['']
let P= vital#of('vital').import('ProcessManager')
call P.touch('ane', 'sqlite3 hoge.db')
call P.writeln('ane', 'drop table if exists abc;')
call P.writeln('ane', 'create table abc (' . join(map(range(1, 1000), '"ol" . v:val'), ', ') . ');')
echo P.read('ane', endpatterns)
function! s:curtext(expr)
let line= getline('.')
let pos= col('.')
let s= 0
while s < pos
let [s, e]= [match(line, a:expr, s), matchend(line, a:expr, s)]
if s < 0
break
elseif s < pos && pos <= e
" The MIT License (MIT)
"
" Copyright (c) 2014 kamichidu
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to deal
" in the Software without restriction, including without limitation the rights
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
" autoload/quickrun/hook/psqlconfig.vim
let s:save_cpo = &cpo
set cpo&vim
let s:hook = {
\ 'kind': 'hook',
\ 'name': 'psqlconfig',
\ 'config': {
\ 'enable': 0,
\ 'patterns': ['^--\s*\(\w\+\)\s*=\s*\(\S.*\)$'],
-- host= localhost
-- port= 5433
-- dbname= hoge
-- username= piyo
select
'こんな感じ'
;