Skip to content

Instantly share code, notes, and snippets.

@ripxorip
Last active November 29, 2018 14:38
Show Gist options
  • Save ripxorip/39d6d15cc1562d09651f0f602f5ac07e to your computer and use it in GitHub Desktop.
Save ripxorip/39d6d15cc1562d09651f0f602f5ac07e to your computer and use it in GitHub Desktop.
Most important parts of my bashrc
set -o vi
bind '"jk":vi-movement-mode'
alias c="cd"
alias ..="cd .."
alias v="nvim"
alias l="ls -la"
fe() {
local files
IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0))
[[ -n "$files" ]] && ${EDITOR:-nvim} "${files[@]}"
}
# fd - cd to selected directory
fd() {
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
bind -x '"\C-f": fe'
bind -x '"\C-g": fd '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment