This file contains 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 do_space() { | |
if [ "$BUFFER" = " " ]; then | |
LBUFFER="git " | |
else | |
LBUFFER="$LBUFFER " | |
fi | |
} | |
zle -N do_space | |
bindkey ' ' do_space |
This file contains 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 do_enter() { | |
if [ -z "$BUFFER" ]; then | |
echo | |
ls -F | |
elif [ "$BUFFER" = " " ]; then | |
if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ]; then | |
echo | |
echo -e "\e[0;33m--- git status ---\e[0m" | |
git status -s | |
fi |
This file contains 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
let (|>) x f = f x | |
let (|-) f g = fun x -> g (f x) | |
let getOrElse defVal = function | |
| Some(v) -> v | |
| None -> defVal | |
type ty = | |
| TyArr of ty * ty (* arrow type *) | |
| TyBool |
This file contains 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
foldl' :: (a -> b -> a) -> a -> [b] -> a | |
foldl' f acc [] = acc | |
foldl' f acc (x:xs) = foldl' f (f acc x) xs | |
foldr' :: (a -> b -> b) -> b -> [a] -> b | |
foldr' f acc [] = acc | |
foldr' f acc (x:xs) = f x (foldr' f acc xs) |
This file contains 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
syn region schemeParen0 matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=ALLBUT,schemeParen0,schemeParen2,schemeParen3,schemeParen4,schemeParen5,schemeParen6,schemeParen7,schemeParen8,schemeParen9 | |
syn region schemeParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=ALLBUT,schemeParen1,schemeParen3,schemeParen4,schemeParen5,schemeParen6,schemeParen7,schemeParen8,schemeParen9,schemeParen0 | |
syn region schemeParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=ALLBUT,schemeParen2,schemeParen4,schemeParen5,schemeParen6,schemeParen7,schemeParen8,schemeParen9,schemeParen0,schemeParen1 | |
syn region schemeParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=ALLBUT,schemeParen3,schemeParen5,schemeParen6,schemeParen7,schemeParen8,schemeParen9,schemeParen0,schemeParen1,schemeParen2 | |
syn region schemeParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=ALLBUT,schemeParen4,schemeParen6, |
This file contains 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
diff -r c8559a2d8e5f runtime/ftplugin/ocaml.vim | |
--- a/runtime/ftplugin/ocaml.vim Sun Jul 21 17:06:00 2013 +0200 | |
+++ b/runtime/ftplugin/ocaml.vim Mon Jul 22 00:34:09 2013 +0900 | |
@@ -44,19 +44,21 @@ | |
" (un)commenting | |
if !hasmapto('<Plug>Comment') | |
nmap <buffer> <LocalLeader>c <Plug>LUncomOn | |
- vmap <buffer> <LocalLeader>c <Plug>BUncomOn | |
+ xmap <buffer> <LocalLeader>c <Plug>BUncomOn | |
nmap <buffer> <LocalLeader>C <Plug>LUncomOff |
This file contains 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
fn :: [String] -> Int -> String | |
fn ~(h:t) n = if n == 0 | |
then "oops." | |
else h ++ ":" ++ show t | |
main :: IO () | |
main = putStrLn $ fn [] 0 |
This file contains 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
-- S E N D | |
-- + M O R E | |
-- --------- | |
-- M O N E Y | |
import Data.List | |
digitsToNum :: [Int] => Int | |
digitsToNum = foldl (\acc x -> 10*acc + x) 0 |
This file contains 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
let s:V = vital#of('vital') | |
let s:S = s:V.import('Data.String') | |
let start = reltime() | |
let test1 = s:S.substitute_last(repeat('vim is vital', 1000), 'i', 'ooo') | |
let elapsed = reltimestr(reltime(start)) | |
echo "substitute last" elapsed | |
let start = reltime() | |
let test2 = substitute(repeat('vim is vital', 1000), 'i', 'ooo', '') | |
let elapsed = reltimestr(reltime(start)) |
This file contains 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('vim_starting') | |
set runtimepath+=~/tmp/bundle/neobundle.vim/ | |
endif | |
call neobundle#rc(expand('~/tmp/bundle/')) | |
NeoBundleLazy 'Shougo/vimfiler', { | |
\ 'autoload' : { | |
\ 'commands' : ['VimFiler'], | |
\ }} |