YADR can be installed to any directory and everything still works
This commit is contained in:
parent
a658b815f5
commit
42104de0aa
@ -1,2 +1,4 @@
|
|||||||
Dir[File.join(File.dirname(__FILE__),"lib/**/lib")].each {|dir| $LOAD_PATH << dir}
|
Dir[File.join(File.dirname(__FILE__),"lib/**/lib")].each {|dir| $LOAD_PATH << dir}
|
||||||
require 'git-style-binary/command'
|
require 'git-style-binary/command'
|
||||||
|
|
||||||
|
$yadr = `find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`.chomp
|
||||||
|
@ -6,7 +6,7 @@ GitStyleBinary.command do
|
|||||||
short_desc "Initialize all submodules. Run this every time you pull a new yadr version."
|
short_desc "Initialize all submodules. Run this every time you pull a new yadr version."
|
||||||
|
|
||||||
run do |command|
|
run do |command|
|
||||||
system("cd ~/.dotfiles && git submodule init && git submodule update")
|
`cd "#{$yadr}" && git submodule update --init`
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -14,7 +14,7 @@ GitStyleBinary.command do
|
|||||||
begin
|
begin
|
||||||
repo=command[:url]
|
repo=command[:url]
|
||||||
bundle_path=repo.gsub("https://github.com/","").gsub(".git","").gsub("/","-").gsub(".vim","")
|
bundle_path=repo.gsub("https://github.com/","").gsub(".git","").gsub("/","-").gsub(".vim","")
|
||||||
system("cd ~/.dotfiles && git submodule add #{repo} vim/bundle/#{bundle_path}")
|
system("cd #{$yadr} && git submodule add #{repo} vim/bundle/#{bundle_path}")
|
||||||
rescue
|
rescue
|
||||||
puts "Sorry, couldn't parse your path: #{$!}"
|
puts "Sorry, couldn't parse your path: #{$!}"
|
||||||
end
|
end
|
||||||
|
@ -3,11 +3,10 @@ require File.join(File.dirname(__FILE__), 'default_libs')
|
|||||||
|
|
||||||
GitStyleBinary.command do
|
GitStyleBinary.command do
|
||||||
version "yadr-vim-update-plugins 1.0"
|
version "yadr-vim-update-plugins 1.0"
|
||||||
|
short_desc "Update all vim plugins to latest versions from github"
|
||||||
short_desc "Update all vim plugins to latest versions from github"
|
|
||||||
|
|
||||||
run do |command|
|
run do |command|
|
||||||
system("cd ~/.dotfiles && git submodule foreach git pull origin master")
|
`cd "#{$yadr}" && git submodule foreach git pull origin master`
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
# Aliases in this file are bash and zsh compatible
|
# Aliases in this file are bash and zsh compatible
|
||||||
|
|
||||||
|
# Don't change. The following determines where YADR is installed.
|
||||||
|
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||||
|
|
||||||
# YADR support
|
# YADR support
|
||||||
alias yav='yadr vim-add-plugin'
|
alias yav='yadr vim-add-plugin'
|
||||||
alias yuv='yadr vim-update-plugins'
|
alias yuv='yadr vim-update-plugins'
|
||||||
@ -23,8 +26,8 @@ alias du='du -h -d 2'
|
|||||||
alias lsg='ll | grep'
|
alias lsg='ll | grep'
|
||||||
|
|
||||||
# Alias Editing
|
# Alias Editing
|
||||||
alias ae='vi ~/.dotfiles/zsh/aliases' #alias edit
|
alias ae='vi $yadr/zsh/aliases' #alias edit
|
||||||
alias ar='source ~/.dotfiles/zsh/aliases' #alias reload
|
alias ar='source $yadr/zsh/aliases' #alias reload
|
||||||
|
|
||||||
# vimrc editing
|
# vimrc editing
|
||||||
alias ve='vi ~/.vimrc'
|
alias ve='vi ~/.vimrc'
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
# Path to your oh-my-zsh configuration.
|
|
||||||
ZSH=$HOME/.oh-my-zsh
|
|
||||||
|
|
||||||
# Set name of the theme to load.
|
|
||||||
# Look in ~/.oh-my-zsh/themes/
|
|
||||||
# skwp theme comes from skwp/oh-my-zsh fork
|
|
||||||
ZSH_THEME="skwp"
|
|
||||||
|
|
||||||
# Comment this out to disable weekly auto-update checks
|
|
||||||
DISABLE_AUTO_UPDATE="true"
|
|
||||||
|
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
||||||
plugins=(git rvm ruby rails autojump)
|
|
||||||
|
|
||||||
# Load default oh-my-zsh stuff
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
|
||||||
|
|
||||||
# Customize to your needs...
|
|
||||||
export PATH=/usr/local/git/bin:/op/local/bin:/opt/local/sbin:/usr/bin:/Users/yan/dev/cluster/script:/Users/yan/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/lib/postgresql84/bin:/usr/local/bin:/Users/yan/dev/ec2/ec2-api/bin:/opt/local/lib/mysql5/bin:/Users/yan/.rvm/bin:/Users/yan/.dotfiles/bin:/Users/yan/.dotfiles/bin/willmorgan/bin
|
|
||||||
|
|
||||||
# Load YADR zshrc
|
|
||||||
source ~/.dotfiles/zsh/zshrc
|
|
1
zsh/oh_my_zsh_zshrc
Symbolic link
1
zsh/oh_my_zsh_zshrc
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
zshrc
|
25
zsh/zshrc
25
zsh/zshrc
@ -1,6 +1,25 @@
|
|||||||
|
# Source oh-my-zsh if it is installed.
|
||||||
|
if [[ -d $HOME/.oh-my-zsh ]]; then
|
||||||
|
# Path to your oh-my-zsh configuration.
|
||||||
|
ZSH=$HOME/.oh-my-zsh
|
||||||
|
|
||||||
|
# Set name of the theme to load.
|
||||||
|
ZSH_THEME="skwp"
|
||||||
|
|
||||||
|
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||||
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
|
plugins=(git rvm ruby rails autojump)
|
||||||
|
|
||||||
|
# Load default oh-my-zsh stuff
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Don't change. The following determines where YADR is installed.
|
||||||
|
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
source ~/.dotfiles/zsh/aliases
|
source $yadr/zsh/aliases
|
||||||
source ~/.dotfiles/zsh/zsh_aliases
|
source $yadr/zsh/zsh_aliases
|
||||||
|
|
||||||
# Things I don't want to publish to github
|
# Things I don't want to publish to github
|
||||||
source ~/.secrets
|
source ~/.secrets
|
||||||
@ -29,4 +48,4 @@ zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
|||||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
||||||
|
|
||||||
# Add path to our custom bins
|
# Add path to our custom bins
|
||||||
export PATH=$PATH:~/.dotfiles/bin:~/.dotfiles/bin/yadr
|
export PATH=$PATH:$yadr/bin:$yadr/bin/yadr
|
||||||
|
Loading…
Reference in New Issue
Block a user