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
// // 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) |
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
# 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 |