diff --git a/dotfiles b/dotfiles new file mode 100755 index 0000000..56a9b95 --- /dev/null +++ b/dotfiles @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +function link_test() { + [[ "$1" -ef "$2" ]] && echo "same file" +} + +function link_file() { + ln -sf ${2#$HOME/} ~/ +} + +function copy_or_link() { + local base dest + local cmd="find $HOME/dotfiles/$1 -mindepth 1 -maxdepth 1" + + # If no files, bail + if [ "x`${cmd}`" == "x" ]; then return; fi + + for file in `${cmd}`; do + base="$(basename $file)" + dest="$HOME/$base" + echo "$base -> $dest" + + "$1_file" "$base" "$file" + done +} + +copy_or_link "link" +# copy_or_link "copy" diff --git a/link/.zlogin b/link/.zlogin new file mode 120000 index 0000000..82edd37 --- /dev/null +++ b/link/.zlogin @@ -0,0 +1 @@ +.zpresto/runcoms/zlogin \ No newline at end of file diff --git a/link/.zlogout b/link/.zlogout new file mode 120000 index 0000000..435949f --- /dev/null +++ b/link/.zlogout @@ -0,0 +1 @@ +.zpresto/runcoms/zlogout \ No newline at end of file diff --git a/link/.zpreztorc b/link/.zpreztorc new file mode 100644 index 0000000..8cdb163 --- /dev/null +++ b/link/.zpreztorc @@ -0,0 +1,143 @@ +# +# Sets Prezto options. +# +# Authors: +# Sorin Ionescu +# + +# +# General +# + +# Set case-sensitivity for completion, history lookup, etc. +# zstyle ':prezto:*:*' case-sensitive 'yes' + +# Color output (auto set to 'no' on dumb terminals). +zstyle ':prezto:*:*' color 'yes' + +# Set the Zsh modules to load (man zshmodules). +# zstyle ':prezto:load' zmodule 'attr' 'stat' + +# Set the Zsh functions to load (man zshcontrib). +# zstyle ':prezto:load' zfunction 'zargs' 'zmv' + +# Set the Prezto modules to load (browse modules). +# The order matters. +zstyle ':prezto:load' pmodule \ + 'environment' \ + 'terminal' \ + 'editor' \ + 'history' \ + 'directory' \ + 'spectrum' \ + 'utility' \ + 'completion' \ + 'prompt' + +# +# Editor +# + +# Set the key mapping style to 'emacs' or 'vi'. +zstyle ':prezto:module:editor' key-bindings 'emacs' + +# Auto convert .... to ../.. +# zstyle ':prezto:module:editor' dot-expansion 'yes' + +# +# Git +# + +# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'. +# zstyle ':prezto:module:git:status:ignore' submodules 'all' + +# +# GNU Utility +# + +# Set the command prefix on non-GNU systems. +# zstyle ':prezto:module:gnu-utility' prefix 'g' + +# +# History Substring Search +# + +# Set the query found color. +# zstyle ':prezto:module:history-substring-search:color' found '' + +# Set the query not found color. +# zstyle ':prezto:module:history-substring-search:color' not-found '' + +# Set the search globbing flags. +# zstyle ':prezto:module:history-substring-search' globbing-flags '' + +# +# Pacman +# + +# Set the Pacman frontend. +# zstyle ':prezto:module:pacman' frontend 'yaourt' + +# +# Prompt +# + +# Set the prompt theme to load. +# Setting it to 'random' loads a random theme. +# Auto set to 'off' on dumb terminals. +zstyle ':prezto:module:prompt' theme 'sorin' + +# +# Screen +# + +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:screen:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:screen:auto-start' remote 'yes' + +# +# SSH +# + +# Set the SSH identities to load into the agent. +# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' + +# +# Syntax Highlighting +# + +# Set syntax highlighters. +# By default, only the main highlighter is enabled. +# zstyle ':prezto:module:syntax-highlighting' highlighters \ +# 'main' \ +# 'brackets' \ +# 'pattern' \ +# 'cursor' \ +# 'root' +# +# Set syntax highlighting styles. +# zstyle ':prezto:module:syntax-highlighting' styles \ +# 'builtin' 'bg=blue' \ +# 'command' 'bg=blue' \ +# 'function' 'bg=blue' +# + +# +# Terminal +# + +# Auto set the tab and window titles. +zstyle ':prezto:module:terminal' auto-title 'yes' + +# +# Tmux +# + +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:tmux:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:tmux:auto-start' remote 'yes' + diff --git a/link/.zprofile b/link/.zprofile new file mode 120000 index 0000000..e5fc8ee --- /dev/null +++ b/link/.zprofile @@ -0,0 +1 @@ +.zpresto/runcoms/zprofile \ No newline at end of file diff --git a/link/.zshenv b/link/.zshenv new file mode 120000 index 0000000..1d55dce --- /dev/null +++ b/link/.zshenv @@ -0,0 +1 @@ +.zpresto/runcoms/zshenv \ No newline at end of file diff --git a/link/.zshrc b/link/.zshrc new file mode 100644 index 0000000..e87283f --- /dev/null +++ b/link/.zshrc @@ -0,0 +1,14 @@ +# +# Executes commands at the start of an interactive session. +# +# Authors: +# Sorin Ionescu +# + +# Source Prezto. +if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" +fi + +# Customize to your needs... +