Add README, fix some things

master
Taeyeon Mori 10 years ago
parent 4ad70aac4d
commit e477196e62
  1. 1
      .gitignore
  2. 38
      README.md
  3. 25
      install
  4. 2
      zsh/lib.zsh
  5. 3
      zsh/zlogin
  6. 3
      zsh/zpreztorc
  7. 4
      zsh/zprofile
  8. 24
      zsh/zshrc

1
.gitignore vendored

@ -1,3 +1,4 @@
/zsh/.*
user-info
*.local

@ -0,0 +1,38 @@
Taeyeon's dotfiles (.files)
===========================
As of right now, only contains dotfiles for zsh, vim and git.
.files/install
--------------
A ZShell script to set up the dotfiles. It will also ask a few personal questions.
Run this on a new system to set it up
.files/zsh
----------
The ZSH part makes use of the Prezto framework (http://github.com/sorin-ionescu/prezto)
.files/git
----------
Contains the git configuration (.files/git/config)
\*/user-info
-----------
Contains user information collected at install time.
currently only .files/user-info and .files/git/user-info
.files/dotfiles
---------------
General dotfiles repository. Everything that doesn't need to be special-cased goes here.
$HOME
-----
All dotfiles are symlinked into the home directory or have a proxy file generated.
Known proxies: .gitconfig, .zshenv
\*.local
--------
Files ending on .local are ignored by git.

@ -1,5 +1,5 @@
#!/bin/zsh
# .files installer
# .files/installer
# (c) 2014 MORI Taeyeon
# Paths & Utils
@ -10,23 +10,26 @@ source "$DOT/zsh/lib.zsh"
# Parse commandline
OVERWRITE=false
ASK=true
function print_usage() {
echo "Usage: $0 [--help] [--overwrite]"
echo "Usage: $1 [--help] [--overwrite] [--dont-ask]"
echo
echo "Install Tae's dotfiles"
echo
echo "Parameters:"
echo " -h, --help Display this help message"
echo " --overwrite Just overwrite existing dotfiles"
echo " --dont-ask Don't ask questions. Use default values"
}
for arg in "$@"; do
[[ -z "$STATE" ]] && {
case "$arg" in
-h|--help) print_usage; exit 0;;
-h|--help) print_usage "$0"; exit 0;;
--overwrite) OVERWRITE=true;;
*) print_usage; exit 1;;
--dont-ask) ASK=false;;
*) print_usage "$0"; exit 1;;
esac
} || {
case "$STATE" in
@ -59,13 +62,19 @@ msg "Updating git submodules..."
git submodule update --init --recursive
# Ask questions about user
msg "Asking questions..."
$ASK && msg "Asking questions..." || err "Not asking any questions:"
[[ -e "$DOT/user-info" ]] && source "$DOT/user-info"
[[ -z "$REAL_NAME" ]] && REALNAME=`grep "^$USER:[^:]*:$UID:" /etc/passwd | cut -d: -f5 | cut -d, -f1`
ask "Real name" REALNAME
ask "E-Mail address" EMAIL
[[ -z "$REALNAME" ]] && REALNAME=`grep "^$USER:[^:]*:$UID:" /etc/passwd | cut -d: -f5 | cut -d, -f1`
if $ASK; then
ask " Real name" REALNAME
ask " E-Mail address" EMAIL
else
color 36 echo " default REALNAME=\"$REALNAME\""
color 36 echo " default EMAIL=\"$EMAIL\""
fi
generate "$DOT/user-info" <<EOF
REALNAME="$REALNAME"

@ -37,7 +37,7 @@ function random_choice() {
shuf -n1 -e "$@"
else
local NUMBER=${RANDOM%$#+1}
echo ${!NUMBER}
echo ${(P)NUMBER}
fi
}

@ -16,7 +16,8 @@
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
print -n "\e[34m"
fortune -a
print
print "\e[0m"
fi

@ -36,7 +36,8 @@ zstyle ':prezto:load' pmodule \
'syntax-highlighting' \
'git' \
'python' \
'pacman'
'pacman' \
'command-not-found'
#
# Editor

@ -44,6 +44,7 @@ typeset -gU cdpath fpath mailpath path
# Set the list of directories that Zsh searches for programs.
path=(
$HOME/.local/bin
$HOME/bin
/usr/local/{bin,sbin}
$path
)
@ -76,3 +77,6 @@ if [[ ! -d "$TMPPREFIX" ]]; then
mkdir -p "$TMPPREFIX"
fi
# Local overrides
[[ -e "$DOTFILES/zsh/zprofile.local" ]] && source "$DOTFILES/zsh/zprofile.local"

@ -12,3 +12,27 @@ fi
# Customize to your needs...
# Revive old gst alias from OMZ/git
alias gst="git status"
# git update fork
# Merge upstream
function gupf {
(
set -e
local ORIGIN=${1-origin}
local UPSTREAM=${2-upstream}
git fetch $ORIGIN
git fetch $UPSTREAM
git checkout $ORIGIN/master
git checkout -b merge
git merge $UPSTREAM/master -m "merge upstream from `git ls-remote --get-url $UPSTREAM`"
git checkout master
git rebase merge
git branch -d merge
)
}
# Local overrides
[[ -e "$DOTDIR/zsh/zshrc.local" ]] && source "$DOTDIR/zsh/zshrc.local"

Loading…
Cancel
Save