Fix for Linux and make consistent

This commit is contained in:
Loic Nageleisen 2021-03-02 12:41:07 +01:00
parent e317caaa8f
commit 9ca56d83c7
42 changed files with 106 additions and 52 deletions

View file

@ -22,4 +22,4 @@ set_color() {
[[ $prompt -eq 1 ]] && echo -n "\]" [[ $prompt -eq 1 ]] && echo -n "\]"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -120,4 +120,4 @@ ansi_sgr() {
eval "echo -n \$ANSI_SGR_INDEX__${key}__" eval "echo -n \$ANSI_SGR_INDEX__${key}__"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -89,4 +89,4 @@ ansi_sgr() {
echo -n ${ANSI_SGR_INDEX[$1]} echo -n ${ANSI_SGR_INDEX[$1]}
} }
# vim: ft=sh # vim: ft=bash

View file

@ -54,3 +54,4 @@ clear_incomplete_line() {
fi fi
} }
# vim: ft=bash

View file

@ -1,6 +1,3 @@
# shellcheck shell=bash
# vim: ft=sh
if type fzf 1>/dev/null 2>/dev/null; then if type fzf 1>/dev/null 2>/dev/null; then
__fzf_select__() { __fzf_select__() {
@ -58,3 +55,5 @@ bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\e^\er"'
bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"' bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'
fi fi
# vim: ft=bash

View file

@ -13,4 +13,4 @@ export HISTCONTROL=ignoreboth
# more! # more!
export HISTSIZE=10000 export HISTSIZE=10000
# vim: ft=sh # vim: ft=bash

View file

@ -6,4 +6,4 @@ source ~/.profile
# include bashrc too if this is an interactive shell # include bashrc too if this is an interactive shell
[[ $- == *i* ]] && source ~/.bashrc [[ $- == *i* ]] && source ~/.bashrc
# vim: ft=sh # vim: ft=bash

View file

@ -108,4 +108,4 @@ set_prompt() {
PS1="$(prompt_build_simple)" PS1="$(prompt_build_simple)"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -66,4 +66,4 @@ prompt_end() {
CURRENT_BG='' CURRENT_BG=''
} }
# vim: ft=sh: # vim: ft=bash

View file

@ -45,4 +45,4 @@ set bell-style none
# disable deprecation warning # disable deprecation warning
export BASH_SILENCE_DEPRECATION_WARNING=1 export BASH_SILENCE_DEPRECATION_WARNING=1
# vim: ft=sh # vim: ft=bash

View file

@ -15,7 +15,7 @@ fi
set_term_title() { set_term_title() {
case $TERM in case $TERM in
xterm*|rxvt*) xterm*|rxvt*|alacritty)
local title="\033]2;$USER@${HOSTNAME%%.*}:${PWD/#$HOME/~}\a" local title="\033]2;$USER@${HOSTNAME%%.*}:${PWD/#$HOME/~}\a"
;; ;;
*) *)
@ -25,4 +25,4 @@ set_term_title() {
printf "$title" printf "$title"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -11,4 +11,8 @@ esac
alias ll="ls -l" alias ll="ls -l"
alias tree="tree -C" alias tree="tree -C"
which colordiff 2>&1 >/dev/null && alias diff="colordiff" if command -v colordiff 2>&1 >/dev/null; then
alias diff="colordiff"
fi
# vim: ft=bash

View file

@ -1 +0,0 @@
export ANDROID_HOME=/usr/local/opt/android-sdk

View file

@ -1 +1,5 @@
if test -f $HOME/.archrc; then
source $HOME/.archrc source $HOME/.archrc
fi
# vim: ft=bash

View file

@ -3,4 +3,4 @@ for file in "$DOTFILES_SHELL_DIR"/*; do
[[ -x $file ]] && source "$file" [[ -x $file ]] && source "$file"
done done
# vim: ft=sh # vim: ft=bash

View file

@ -3,7 +3,7 @@
bundled_commands=(annotate cap capify cucumber guard heroku nanoc rackup rainbows rails rake rspec rubocop ruby shotgun spec spork thin unicorn unicorn_rails irb pry) bundled_commands=(annotate cap capify cucumber guard heroku nanoc rackup rainbows rails rake rspec rubocop ruby shotgun spec spork thin unicorn unicorn_rails irb pry)
_bundler-installed() { _bundler-installed() {
which bundle > /dev/null 2>&1 command -v bundle > /dev/null 2>&1
} }
_within-bundled-project() { _within-bundled-project() {
@ -36,4 +36,4 @@ for cmd in ${bundled_commands[@]}; do
fi fi
done done
# vim: ft=zsh # vim: ft=bash

View file

@ -1,2 +1,4 @@
export USE_CCACHE=1 export USE_CCACHE=1
export CCACHE_DIR=$HOME/.local/var/ccache export CCACHE_DIR=$HOME/.local/var/ccache
# vim: ft=bash

View file

@ -39,3 +39,5 @@ _auto-chruby() {
chruby "${ruby_version}" chruby "${ruby_version}"
fi fi
} }
# vim: ft=bash

View file

@ -6,3 +6,5 @@ export CLICOLOR
# gnome terminal knows colors # gnome terminal knows colors
[[ "$COLORTERM" == "gnome-terminal" ]] && export TERM=xterm-256color [[ "$COLORTERM" == "gnome-terminal" ]] && export TERM=xterm-256color
[[ "$COLORTERM" == "xfce4-terminal" ]] && export TERM=xterm-256color [[ "$COLORTERM" == "xfce4-terminal" ]] && export TERM=xterm-256color
# vim: ft=bash

View file

@ -4,3 +4,5 @@
#export DOCKER_HOST="tcp://172.16.71.132:2376" #export DOCKER_HOST="tcp://172.16.71.132:2376"
#export DOCKER_CERT_PATH="/Users/lloeki/.docker/machine/machines/default" #export DOCKER_CERT_PATH="/Users/lloeki/.docker/machine/machines/default"
#export DOCKER_MACHINE_NAME="default" #export DOCKER_MACHINE_NAME="default"
# vim: ft=bash

View file

@ -1,5 +1,6 @@
# default editor # default editor
EDITOR=vim EDITOR=vim
VISUAL=vim VISUAL=vim
export EDITOR VISUAL export EDITOR VISUAL
# vim: ft=bash

View file

@ -1,2 +1,6 @@
if command -v rg 2>&1 >/dev/null; then
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!{.git,node_modules}/*"' export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!{.git,node_modules}/*"'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
fi
# vim: ft=bash

View file

@ -185,4 +185,4 @@ __git_ps1_vars() {
GIT_PS1_PREFIX="$prefix" GIT_PS1_PREFIX="$prefix"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -1,5 +1,5 @@
_go-installed() { _go-installed() {
which go > /dev/null 2>&1 command -v go > /dev/null 2>&1
} }
_within-go-project() { _within-go-project() {
@ -75,4 +75,4 @@ _link-go-package() {
ln -sf "$PWD" "$src/$pkgn" ln -sf "$PWD" "$src/$pkgn"
} }
# vim: ft=sh # vim: ft=bash

View file

@ -1 +1,3 @@
export PATH="$HOME/.local/libexec/go/bin:$PATH" export PATH="$HOME/.local/libexec/go/bin:$PATH"
# vim: ft=bash

View file

@ -1,3 +1,4 @@
if command -v brew 2>&1 >/dev/null; then
# go # go
PATH=$PATH:/usr/local/opt/go/libexec/bin PATH=$PATH:/usr/local/opt/go/libexec/bin
@ -6,3 +7,6 @@ HOMEBREW_NO_AUTO_UPDATE="1"
export HOMEBREW_NO_AUTO_UPDATE export HOMEBREW_NO_AUTO_UPDATE
export HOMEBREW_NO_EMOJI export HOMEBREW_NO_EMOJI
fi
# vim: ft=bash

View file

@ -1,7 +1,7 @@
# vim: ft=sh # vim: ft=bash
# shellcheck shell=bash # shellcheck shell=bash
# worKDir # worKDir or quicKDir
function kd() { function kd() {
local conf="$HOME/.kdrc" local conf="$HOME/.kdrc"
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then

View file

@ -1 +1,5 @@
ulimit -S -n 1024 ulimit -S -n 1024
# vim: ft=bash

View file

@ -1,5 +1,9 @@
if [ -e /Users/lloeki/.nix-profile/etc/profile.d/nix.sh ]; then . /Users/lloeki/.nix-profile/etc/profile.d/nix.sh; fi if [[ -e /Users/lloeki/.nix-profile/etc/profile.d/nix.sh ]]; then
. /Users/lloeki/.nix-profile/etc/profile.d/nix.sh
fi
#if [[ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]]; then #if [[ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]]; then
# . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' # . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
#fi #fi
# vim: ft=bash

View file

@ -14,5 +14,4 @@ function note() {
) )
} }
# vim: ft=zsh # vim: ft=bash

View file

@ -49,4 +49,4 @@ prompt_subsegment() {
[[ -n $1 ]] && print -Pn $1 [[ -n $1 ]] && print -Pn $1
} }
# vim: ft=sh: # vim: ft=bash

View file

@ -39,3 +39,5 @@ __truncate_path() {
__tpwd() { __tpwd() {
__truncate_path "$PWD" __truncate_path "$PWD"
} }
# vim: ft=bash

View file

@ -66,4 +66,4 @@ prompt_vcs_action() {
fi fi
} }
# vim: ft=sh: # vim: ft=bash

View file

@ -1,4 +1,10 @@
# pyenv # pyenv
test -d "$HOME/.pyenv/bin" && PATH="$HOME/.pyenv/bin:$PATH" if test -d "$HOME/.pyenv/bin"; then
which pyenv 2>&1 >/dev/null && eval "$(pyenv init -)" PATH="$HOME/.pyenv/bin:$PATH"
fi
if command -v pyenv 2>&1 >/dev/null; then
eval "$(pyenv init -)"
fi
export PATH export PATH
# vim: ft=bash

View file

@ -1,6 +1,3 @@
# vim: ft=sh
# shellcheck shell=bash
test -d "/opt/rbenv" && RBENV_ROOT="/opt/rbenv" test -d "/opt/rbenv" && RBENV_ROOT="/opt/rbenv"
test -d "$HOME/.rbenv" && RBENV_ROOT="$HOME/.rbenv" test -d "$HOME/.rbenv" && RBENV_ROOT="$HOME/.rbenv"
export RBENV_ROOT export RBENV_ROOT
@ -15,3 +12,5 @@ if _has-rbenv; then
eval "$(rbenv init -)" eval "$(rbenv init -)"
export PATH export PATH
fi fi
# vim: ft=bash

View file

@ -1,6 +1,3 @@
# vim: ft=sh
# shellcheck shell=bash
_gem_home() { _gem_home() {
GEM_HOME="${HOME}/.gem/ruby/system" GEM_HOME="${HOME}/.gem/ruby/system"
export GEM_HOME export GEM_HOME
@ -25,3 +22,5 @@ _auto-rubygems_gemdeps() {
done done
unset RUBYGEMS_GEMDEPS unset RUBYGEMS_GEMDEPS
} }
# vim: ft=bash

13
shell/ssh Normal file → Executable file
View file

@ -1,6 +1,11 @@
# ssh keychain, if no agent set # start ssh agent, if no agent set
if [ -z "$SSH_AUTH_SOCK" ]; then if [[ -n "${XDG_RUNTIME_DIR}" && -z "${SSH_AUTH_SOCK}" ]]; then
if which envoy 2>&1 >/dev/null; then if ! pgrep -u "$USER" ssh-agent > /dev/null; then
source <(envoy -p) ssh-agent -t 1h > "${XDG_RUNTIME_DIR}/ssh-agent.env"
fi
if [[ ! -S "${SSH_AUTH_SOCK}" ]] && [[ -f "${XDG_RUNTIME_DIR}/ssh-agent.env" ]]; then
source "${XDG_RUNTIME_DIR}/ssh-agent.env" > /dev/null
fi fi
fi fi
# vim: ft=bash

View file

@ -1,2 +1,5 @@
[ -f /usr/local/share/ca-bundle.crt ] \ if [[ -f /usr/local/share/ca-bundle.crt ]]; then
&& export SSL_CERT_FILE=/usr/local/share/ca-bundle.crt export SSL_CERT_FILE=/usr/local/share/ca-bundle.crt
fi
# vim: ft=bash

View file

@ -1,3 +1,5 @@
# user path # user path
PATH=~/.local/bin:$PATH PATH=~/.local/bin:$PATH
export PATH export PATH
# vim: ft=bash

View file

@ -78,3 +78,5 @@ bindkey '^R' fzf-history-widget
fi fi
fi fi
# vim: ft=zsh

View file

@ -64,3 +64,4 @@ rprompt_end() {
CURRENT_BG='' CURRENT_BG=''
} }
# vim: ft=zsh

2
zsh/vi
View file

@ -5,3 +5,5 @@ KEYTIMEOUT=1
bindkey -sM vicmd '^[' '^G' bindkey -sM vicmd '^[' '^G'
# fix ^X shortcuts # fix ^X shortcuts
bindkey -rM viins '^X' bindkey -rM viins '^X'
# vim: ft=zsh