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)
@Jessidhia
Jessidhia / zsh-history-search-with-peco.zsh
Last active April 29, 2016 05:17 — forked from jimeh/zsh-history-search-with-peco.zsh
Use peco (https://github.com/peco/peco) to search ZSH's history via ctrl+R
# 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