configuration/zshrc

60 lines
1.4 KiB
Bash
Raw Normal View History

2017-02-09 10:37:31 +01:00
# vim: foldmethod=marker
2014-11-27 20:52:06 +01:00
2017-02-09 10:37:31 +01:00
# Lines configured by zsh-newuser-install {{{
HISTFILE=~/.cache/zhistfile
2014-11-27 20:52:06 +01:00
HISTSIZE=1000
SAVEHIST=1000
2017-02-09 10:37:31 +01:00
bindkey -e
# }}}
#
# The following lines were added by compinstall {{{
zstyle ':completion:*' completer _complete _ignored
2016-09-21 17:21:42 +02:00
zstyle :compinstall filename '/home/noctua/.zshrc'
2014-11-27 20:52:06 +01:00
autoload -Uz compinit
compinit
2017-02-09 10:37:31 +01:00
# }}}
2014-11-27 20:52:06 +01:00
# Get ourselves a nice prompt.
git_status() {
if git status 2>/dev/null 1>&2; then
git branch | grep \*
git status --porcelain | cat <(echo OK) - | sed 's/\(..\).*/(\1)/' | tail -1
fi
}
autoload -U colors && colors
PS1="[%*] %{$fg[red]%}%n@%m%{$reset_color%} %{$fg[green]%}%~%{$reset_color%} "'$(git_status | xargs echo)'"
2014-11-27 20:52:06 +01:00
%(?.$.%%) "; setopt promptsubst
2016-03-29 13:24:14 +02:00
# Loading fizsh
source "$HOME/.config/zsh/zsh-history-substring-search.zsh"
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
setopt HIST_FIND_NO_DUPS
2014-11-27 20:52:06 +01:00
# Color ls
2016-12-02 14:45:16 +01:00
alias ls="lr -1FG"
2014-11-27 20:52:06 +01:00
2016-06-28 09:40:07 +02:00
# No need for less history and more
alias less="LESSHISTFILE=- less"
alias more="less"
2016-09-21 17:21:42 +02:00
# There is only one vim
2016-03-16 23:54:53 +01:00
alias vim="nvim"
2015-12-30 01:30:14 +01:00
alias vi="nvim"
alias nano="nvim"
2014-11-27 20:52:06 +01:00
2016-09-21 17:21:42 +02:00
# Ready for ssh'ing
alias agent='eval "$(ssh-agent)" && ssh-add'
2015-05-04 20:23:46 +02:00
2016-11-22 11:41:51 +01:00
# Cloning my terminal
2017-02-09 10:37:31 +01:00
alias terminal='st'
alias copy='terminal'
2016-11-22 11:41:51 +01:00
2016-12-20 15:04:50 +01:00
# FZF
function go() {
2017-01-03 15:36:06 +01:00
dir="$(lr /home /data /etc -L -t '(name ~~ "\.*" && prune || print) && type = d && !(name = ".git")' | fzf)"
2016-12-20 15:04:50 +01:00
[ -n "$dir" ] && cd "$dir" || false
}