Skip to content

Instantly share code, notes, and snippets.

View jan-warchol's full-sized avatar

Jan Warchoł jan-warchol

View GitHub Profile
@jan-warchol
jan-warchol / gist:f7e556267fede72ab41e
Last active November 29, 2015 16:11 — forked from mbadran/gist:130469
replace cd in bash to (silent) pushd
# "cd with history"
#
# Bash has a nice feature called "directory stack" - sort of "location history":
# https://www.gnu.org/software/bash/manual/html_node/The-Directory-Stack.html
# However, I find the built-in commands not really convenient. This makes the
# directory stack available as a sort of extension to `cd` interface.
function _cd {
# typing just `_cd` will take you $HOME ;)
if [ "$1" == "" ]; then
@jan-warchol
jan-warchol / functions.sh
Last active June 26, 2017 09:04 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}