From 714c14fc061167a6944345486d689a139c0d632d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Thu, 13 Feb 2020 14:21:42 +0100 Subject: [PATCH] Update --- aliases/functions | 5 +++-- completion.zsh | 3 ++- env/50_rust.zsh | 2 +- zshrc | 10 ++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/aliases/functions b/aliases/functions index ba2f749..f0a549c 100644 --- a/aliases/functions +++ b/aliases/functions @@ -4,8 +4,8 @@ # daily use aliases ##############################################################################{{{ -alias ls="ls -N --color=auto" -alias ll="ls -hl --group-directories-first" +alias ls="ls --group-directories-first -N --color=auto" +alias ll="ls -hl" alias lll="ls -hla" alias ds="du -sh" alias :q="exit" @@ -260,6 +260,7 @@ svn() { } alias gitv='vim "$(git rev-parse --git-dir)/index" -c "Gitv --all" -c tabonly' +alias ipy=ipython3 #}}} diff --git a/completion.zsh b/completion.zsh index a835ceb..17e33f9 100644 --- a/completion.zsh +++ b/completion.zsh @@ -5,6 +5,7 @@ fpath=( "${ZDOTDIR:+$ZDOTDIR/compdef}" "/etc/zsh/compdef" $fpath ) [[ -n $(echo $ZDOTDIR/compdef/*(N:t)) ]] && autoload -U $ZDOTDIR/compdef/*(N:t) autoload -Uz compinit && compinit -u +autoload -U +X bashcompinit && bashcompinit zstyle ':completion:*:descriptions' format ‘%B%d%b’ zstyle ':completion:*:messages' format ‘%d’ @@ -29,7 +30,7 @@ zstyle :compinstall filename '/etc/zsh/completion' # completion for programs with standard gnu --help -for prog in amm tapestry virtualenv; do +for prog in amm tapestry virtualenv dragon; do compdef _gnu_generic $prog done diff --git a/env/50_rust.zsh b/env/50_rust.zsh index 8ea35ad..18201a6 100644 --- a/env/50_rust.zsh +++ b/env/50_rust.zsh @@ -1,3 +1,3 @@ -if which rustup &>/dev/null; then +if which rustup &>/dev/null && [[ -n $(rustup show active-toolchain) ]]; then export RUST_SRC_PATH=$(rustup run stable rustc --print sysroot)/lib/rustlib/src/rust/src fi diff --git a/zshrc b/zshrc index 9d890b9..af4de4d 100644 --- a/zshrc +++ b/zshrc @@ -16,6 +16,8 @@ setopt cdable_vars export ZDOTDIR=${ZDOTDIR:-$HOME/.zsh} +function exists { command -v "$@" >/dev/null } + # get a file from ZDOTDIR, return file in /etc/zsh if it does not exist zdotfile() { if [[ -e $ZDOTDIR/$1 ]]; then @@ -53,3 +55,11 @@ if ! (grep -q 'local' <<<$PATH && grep -q 'sbin' <<<$PATH); then fi FZF_ALT_C_COMMAND="fd -t d" +[[ -e /usr/share/doc/fzf/key-bindings.zsh ]] && . /usr/share/doc/fzf/key-bindings.zsh + +if exists stack; then + eval "$(stack --bash-completion-script stack)" +fi + +exists todo && todo +eval $(thefuck --alias)