Skip to content

Instantly share code, notes, and snippets.

View Jessidhia's full-sized avatar

Jessica Franco Jessidhia

  • @pixiv Inc, pixiv desktop
  • Tokyo, Japan
View GitHub Profile
@Jessidhia
Jessidhia / esm-example.js
Last active February 14, 2017 01:28 — forked from bmeck/esm-example.js
// // given
//
// import foo from "bar"
// export let a
// export { a as b }
// export function hoisted() {}
// export {readFile} from "fs"
// export * from "path"
//
// console.log(foo)
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if [ "$(which peco &>/dev/null && echo 'a' | peco --select-1)" = 'a' ]; then
function peco_select_history() {
local lbuf="$LBUFFER"
BUFFER=
zle -c -U "$(print -rl - $history | peco --layout=bottom-up --query "$lbuf")"
}
zle -N peco_select_history
bindkey '^R' peco_select_history