Skip to content

Instantly share code, notes, and snippets.

@rawaludin
Created June 11, 2018 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawaludin/c7b2bc1dca6fd3ad6b6ac4747104f4eb to your computer and use it in GitHub Desktop.
Save rawaludin/c7b2bc1dca6fd3ad6b6ac4747104f4eb to your computer and use it in GitHub Desktop.
#
# User configuration sourced by interactive shells
#
# Change default zim location
export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
# Start zim
[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
# Load alias, function, etc
source "${ZDOTDIR:-$HOME}/.alias.sh"
source "${ZDOTDIR:-$HOME}/.function.sh"
# history-substring-search ^p ^n or up down (in vim mode) to search
bindkey '^P' history-substring-search-up
bindkey '^N' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
# z quick jump
. ~/dotfiles/bin/z.sh
# Configure FZF
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Use fd (https://github.com/sharkdp/fd) instead of the default find
# command for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
# Use fd for fzf
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git --no-ignore-vcs'
# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# preview
export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'"
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
# Modify PATH
export PATH=$HOME/dotfiles/bin:$HOME/.composer/vendor/bin:$HOME/.gem/ruby/2.3.0/bin:/usr/local/opt/apr/bin:$HOME/.cargo/bin:$PATH
# Golang
export PATH=$HOME/go/bin:$PATH
# Golang
# Set the default editor
export EDITOR="nvim"
# ^x^e to edit current command in editor
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
# Install https://github.com/kaelzhang/shell-safe-rm manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment