From 3697eec6e15a9499d957e4af601d081825710f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 16 Apr 2019 19:18:16 +0200 Subject: [PATCH] mord shell --- config/shell/shrc | 53 ++++++++----------- config/shell/zshrc | 3 +- .../user/default.target.wants/psd.service | 1 - tmux.conf | 11 ++++ 4 files changed, 35 insertions(+), 33 deletions(-) delete mode 120000 config/systemd/user/default.target.wants/psd.service create mode 100644 tmux.conf diff --git a/config/shell/shrc b/config/shell/shrc index 28f1a35..cf4ba75 100644 --- a/config/shell/shrc +++ b/config/shell/shrc @@ -45,44 +45,35 @@ trysource() { fi } -# Superseding commands with better ones if they are present -_rank_select() { # executables... -- arguments... - for ex in "$@"; do - [ "$ex" = "--" ] && break - if which "$ex" &>/dev/null; then - for al in "$@"; do - shift - [ "$al" = "--" ] && break - alias "$al"="$ex" - done - "$ex" "$@" - return $? +_i_prefer() { # executables... + for candidate in "$@" + do + if [ -x "$(command -v "$candidate")" ] + then + choice="$candidate" + break fi done - for ex in "$@"; do - [ "$al" = "--" ] && break - if [ -z "$list" ]; then - list=$ex - else - list=$list, $ex + if [ -z "$choice" ] + then + return + fi + for candidate in "$@" + do + if [ "$candidate" != "$choice" ] + then + alias "$candidate"="$choice" fi done - echo "Not installed: $list" } - -_rank_install() { # executables... - for ex in "$@"; do - list=$@ - alias "$ex"="_rank_select $list --" - done -} -_rank_install nvim vim vi -_rank_install gopass pass -_rank_install wakeonlan wol -_rank_install neomutt mutt +_i_prefer nvim vim vi +_i_prefer gopass pass +_i_prefer wakeonlan wol +_i_prefer neomutt mutt +unset _i_prefer ## COLORS -[ -f ~/.local/bin/colorSchemeApply ] && . ~/.local/bin/colorSchemeApply +trysource ~/.local/bin/colorSchemeApply # Needed because xterm/urxvt won't use the last color, needed for vim diff --git a/config/shell/zshrc b/config/shell/zshrc index 3e8b633..eedb84b 100644 --- a/config/shell/zshrc +++ b/config/shell/zshrc @@ -135,6 +135,7 @@ unsetopt AUTO_REMOVE_SLASH trysource /usr/share/fzf/key-bindings.zsh # Help +# TODO Doesn't work (how ironic) autoload -Uz run-help unalias run-help alias help=run-help @@ -164,7 +165,7 @@ setopt PUSHD_MINUS # This reverts the +/- operators. # Command not found -# (since we have syntax highlighting there is no need to wait to see that we typed crap) +# (since we have syntax highlighting we are not forced to wait to see that we typed crap) trysource /usr/share/doc/pkgfile/command-not-found.zsh # History diff --git a/config/systemd/user/default.target.wants/psd.service b/config/systemd/user/default.target.wants/psd.service deleted file mode 120000 index 6f74548..0000000 --- a/config/systemd/user/default.target.wants/psd.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/user/psd.service \ No newline at end of file diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..78b7ec0 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,11 @@ +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' + +set -g @plugin 'jimeh/tmux-themepack' +set -g @themepack 'powerline/block/green' + +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.cache/tmuxplugins/' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run -b '~/.cache/tmuxplugins/tpm/tpm'