This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if has_key(g:toplevel, 'cdlist') | |
let s:cdlist = g:toplevel.cdlist | |
else | |
let s:cdlist = [ | |
\ [ '.git', 'finddir' ], | |
\ [ '.hg', 'finddir' ], | |
\ [ '.bzr', 'finddir' ], | |
\ [ 'foo', 'find' ], | |
\ ] | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Make() abort | |
let path = findfile('Makefile', '.;') | |
if !empty(ret) | |
execute 'lcd' fnamemodify(path, ':h') . '/Makefile' | |
make | |
endif | |
endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Make() abort | |
let path = findfile('Makefile', '.;') | |
if !empty(path) | |
execute 'lcd' fnamemodify(path, ':h') | |
make | |
endif | |
endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun max_eff (xs : int list) : int option = | |
if null xs | |
then NONE | |
else | |
let | |
fun max_nonempty (xs : int list) : int = | |
if null (tl xs) | |
then hd xs | |
else | |
let |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exists('p') | |
unlet p | |
endif | |
if exists('puts') | |
unlet puts | |
endif | |
redir => p | |
silent ruby p RUBY_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:set_cursor() abort | |
let s:oldline = exists('s:newline') ? s:newline : 5 | |
let s:newline = line('.') | |
let headoff = s:headoff + 2 + s:secoff | |
" going down | |
if s:newline > s:oldline | |
while index(s:section_header_lines, s:newline) != -1 | |
let s:newline += 1 | |
endwhile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:session_write(spath) | |
let ssop = &sessionoptions | |
try | |
set sessionoptions-=options | |
execute 'mksession!' a:spath | |
catch | |
execute 'echoerr' string(v:exception) | |
finally | |
let &sessionoptions = ssop | |
endtry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMPLEMENTATION Rabbits | |
IMPORT Denotation ONLY ++ | |
Nat ONLY nat ! 0 1 2 - + > = | |
NatConv ONLY ` | |
String ONLY string | |
StringConv ONLY ` | |
Com ONLY ans:SORT | |
ComCompose COMPLETELY | |
Stream ONLY input stdIn readLine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMPLEMENTATION Queens | |
IMPORT Void COMPLETELY | |
Pair COMPLETELY | |
Option COMPLETELY | |
Seq COMPLETELY | |
SeqMap COMPLETELY | |
SeqFold COMPLETELY | |
BTUnion COMPLETELY | |
Bitset COMPLETELY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
" Works in visual line and visual block mode. | |
" | |
" Select one character more in visual block mode... | |
" | |
function! Transform(prefix, suffix) | |
let [startcol, endcol ] = [col("'<"), col("'>") ] | |
let [startline, endline] = [line("'<"), line("'>")] | |
let startcol = '%'. (startcol ? startcol : 1) .'c' |