zsh: Add some Termux stuff

master
Taeyeon Mori 8 years ago
parent 1ade15c906
commit 6af03b925d
  1. 3
      zsh/zpreztorc
  2. 40
      zsh/zprofile
  3. 26
      zsh/zshrc

@ -32,7 +32,6 @@ zstyle ':prezto:load' pmodule \
'spectrum' \ 'spectrum' \
'utility' \ 'utility' \
'completion' \ 'completion' \
'prompt' \
'syntax-highlighting' \ 'syntax-highlighting' \
'git' \ 'git' \
'pacman' \ 'pacman' \
@ -91,7 +90,7 @@ zstyle ':prezto:module:editor' dot-expansion 'yes'
# Set the prompt theme to load. # Set the prompt theme to load.
# Setting it to 'random' loads a random theme. # Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals. # Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme "tae" #zstyle ':prezto:module:prompt' theme "tae"
# #
# Ruby # Ruby

@ -1,4 +1,4 @@
# vim: ft=sh # vim: ft=zsh
# #
# Executes commands in every top-level shell # Executes commands in every top-level shell
# #
@ -25,17 +25,18 @@
# #
# Browser # Browser
# #
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
export BROWSER=open export BROWSER=open
elif (( $+commands[termux-open] )); then
export BROWSER=termux-open
elif (( $+commands[xdg-open] )); then elif (( $+commands[xdg-open] )); then
export BROWSER=xdg-open export BROWSER=xdg-open
fi fi
# #
# Editors # Editors
# #
if (( $+commands[nvim] )); then if (( $+commands[nvim] )); then
export EDITOR=nvim export EDITOR=nvim
export VISUAL=nvim export VISUAL=nvim
@ -46,14 +47,35 @@ fi
export PAGER='less' export PAGER='less'
# #
# Language # Language
# #
if [[ -z "$LANG" ]]; then if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8' export LANG='en_US.UTF-8'
fi fi
#
# Termux
#
if (( $+commands[termux-info] )); then
export TMPDIR="$PREFIX/tmp"
fi
#
# Terminfo
#
if [[ ! -f "${PREFIX:-/usr}/share/terminfo/${TERM:0:1}/$TERM" ]]; then
if [[ "${TERM:0:7}" == "konsole" ]] || echo $TERM | grep -q 256color; then
export TERM=xterm-256color
else
export TERM=xterm
fi
fi
# #
# Paths # Paths
# #
@ -99,10 +121,10 @@ if (( $+commands[lesspipe.sh] )); then
export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-'
fi fi
# #
# Temporary Files # Temporary Files
# #
if [[ ! -d "$TMPDIR" ]]; then if [[ ! -d "$TMPDIR" ]]; then
export TMPDIR="/tmp/$UID" export TMPDIR="/tmp/$UID"
mkdir -p -m 700 "$TMPDIR" mkdir -p -m 700 "$TMPDIR"
@ -117,7 +139,6 @@ fi
# #
# SSH # SSH
# #
if (( $+commands[systemctl] )); then if (( $+commands[systemctl] )); then
eval "$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')" eval "$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')"
fi fi
@ -130,20 +151,19 @@ export SSH_AUTH_SOCK
# #
# Arch Build system # Arch Build system
# #
if [ -f /etc/arch-release ]; then
export ASPROOT=$HOME/aur/ABS/.asp export ASPROOT=$HOME/aur/ABS/.asp
fi
# #
# LaTeX # LaTeX
# #
export TEXMFHOME=$DOTFILES/texmf export TEXMFHOME=$DOTFILES/texmf
# #
# Local overrides # Local overrides
# #
[[ -e "$DOTFILES/zsh/zprofile.local" ]] && source "$DOTFILES/zsh/zprofile.local" [[ -e "$DOTFILES/zsh/zprofile.local" ]] && source "$DOTFILES/zsh/zprofile.local"

@ -13,11 +13,14 @@ fpath=(
typeset -gU fpath typeset -gU fpath
# #
# Use zplug # Use zplug
# #
export ZPLUG_HOME=$DOTFILES/zsh/zplug export ZPLUG_HOME=$DOTFILES/zsh/zplug
if (( $+commands[termux-info] )); then
rm $ZPLUG_HOME/zcompdump # Broken in Termux
fi
if [[ -s "$ZPLUG_HOME/init.zsh" ]]; then if [[ -s "$ZPLUG_HOME/init.zsh" ]]; then
source "$ZPLUG_HOME/init.zsh" source "$ZPLUG_HOME/init.zsh"
@ -62,22 +65,37 @@ function gupf {
# #
# rsync # rsync
# #
alias rsync="rsync -aXzPvihs -e ssh" alias rsync="rsync -aXzPvihs -e ssh"
# #
# NeoVim # NeoVim
# #
if (( $+commands[nvim] )); then if (( $+commands[nvim] )); then
alias vim=nvim alias vim=nvim
fi fi
# #
# Local overrides # BusyBox
# #
# Kill fancy aliases on BusyBox, since not all GNU options are supported
if (( $+commands[busybox] )); then
for cmd in `busybox --list`; do
if (( $+aliases[$cmd] )); then
__whence="`builtin whence -p $cmd`"
if [ -L "$__whence" ] && command readlink "$__whence" | command grep -q busybox; then
unalias $cmd
fi
fi
unset __whence
done
fi
#
# Local overrides
#
[[ -e "$DOTFILES/zsh/zshrc.local" ]] && source "$DOTFILES/zsh/zshrc.local" [[ -e "$DOTFILES/zsh/zshrc.local" ]] && source "$DOTFILES/zsh/zshrc.local"

Loading…
Cancel
Save