zsh_dots 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,21 +22,16 @@ Features
22
22
  Installation
23
23
  ------------
24
24
 
25
- ### One line install:
25
+ Just run the following commands:
26
26
 
27
- If you really trust me, you can run this simple command in your Terminal to download and install the DOTS framework!
27
+ ```bash
28
+ $ gem install zsh_dots
29
+ $ dots install
30
+ ```
28
31
 
29
- curl -L https://github.com/tubbo/dots/raw/master/tools/install.sh | sh
30
-
31
- ### Manual install:
32
-
33
- For the more paranoid users, here's basically what the above script does:
34
-
35
- git clone git://github.com/tubbo/dots.git ~/.dots
36
- ln -s ~/.dots/config/zshrc ~/.zshrc
37
- chsh -s /bin/zsh
38
-
39
- Then start (or restart) ZSH by reloading or opening a new terminal window.
32
+ This will link the gem's installation to `~/.dots`, and symlink all of
33
+ the files in `~/.dots/config` to your home directory as dotfiles (unless
34
+ existing ones are found).
40
35
 
41
36
  ### Problems?
42
37
 
@@ -48,13 +43,13 @@ Usage
48
43
 
49
44
  There are a number of commands built-in to the DOTS framework:
50
45
 
51
- ### persist <dot-file>
46
+ ### persist DOT_FILE
52
47
 
53
48
  You can persist any dot file with DOTS. Simply run this command on the file...it will copy the
54
49
  file to your `$DOTS` folder and symlink that new file in its original place, preserving your
55
50
  settings in a git repository but making it accessible for the application needing to use it.
56
51
 
57
- ### forget <dot-file>
52
+ ### forget DOT_FILE
58
53
 
59
54
  The opposite of `persist`. Deletes the symlink and restores your file. For when you just need to
60
55
  fuggeddaboutit...
@@ -64,6 +59,35 @@ fuggeddaboutit...
64
59
  For Mac OS X users, this runs a bunch of settings that I found very helpful for browsing and using
65
60
  my Mac. It's totally optional, but this alias simply runs the `tools/osx.zsh` script.
66
61
 
62
+ ### set_title TO_STRING
63
+
64
+ Sets the title of the iTerm window to the String you pass in.
65
+
66
+ ### o, v and e
67
+
68
+ These three commands open, view and edit files, respectively. They use
69
+ the Finder (OS X only), whatever you set as your `$PAGER` and whatever
70
+ you set as your `$EDITOR` to do their tasks. Merely aliases, these
71
+ conventions are prime examples of how DOTS is constructed. They all use
72
+ sensible defaults, for example `o` will open the current directory, but
73
+ `o ~/Code` will open up ~/Code in the Finder. `e` follows suit, but `v`
74
+ throws an error as this should almost never be the case.
75
+
76
+ ### more on e() and macvim
77
+
78
+ `e` has some special functionality for [alloy's MacVim
79
+ fork](http://github.com/alloy/macvim), referred to here as
80
+ `macvim_drawer`.
81
+
82
+ `e`'s functionality is slightly different for users of `macvim_drawer`,
83
+ as `mvim` automatically opens up to a directory for some users of the
84
+ fork. Because of this, `e` detects the use of `mvim` and will perform a
85
+ quick hack to allow you to type `e ~/Code/project` without leaving the
86
+ current directory. It `cd`s into the directory you give it, then opens a
87
+ file that's usually there, like `README.md`. It then `cd`s back to the
88
+ original directory and exits with a success code. You can disable this
89
+ functionality by setting `DRAWER=false` in your zshenv.
90
+
67
91
  Forking
68
92
  -------
69
93
 
@@ -15,6 +15,7 @@ MANPATH=/opt/local/share/man:$MANPATH
15
15
  # Text editing and paging
16
16
  EDITOR='vim'
17
17
  PAGER='less -R'
18
+ DRAWER=true # use macvim_drawer
18
19
 
19
20
  # A more basic version of my promptstring for non-interactive shells.
20
21
  PROMPT="♬ "
@@ -33,7 +33,7 @@ alias v=$PAGER
33
33
 
34
34
  # Terminal support
35
35
  alias c='clear'
36
- alias ti='set_title'
36
+ aliasias ti='set_title'
37
37
  alias o='open .'
38
38
 
39
39
  # Ripple
@@ -21,12 +21,16 @@ function proc() {
21
21
  # functionality of the macvim_drawer plugin. Requires macvim_drawer to be installed,
22
22
  # regular MacVim will break with this function.
23
23
  function e() {
24
- if [[ -f "./README.md" ]]; then
25
- mvim README.md
26
- elif [[ -f "./README.rdoc" ]]; then
27
- mvim README.rdoc
24
+ if [[ $EDITOR == 'mvim']] && [[ $DRAWER == true ]]; then
25
+ if [[ -f "./README.md" ]]; then
26
+ mvim README.md
27
+ elif [[ -f "./README.rdoc" ]]; then
28
+ mvim README.rdoc
29
+ else
30
+ mvim
31
+ fi
28
32
  else
29
- mvim
33
+ $EDITOR
30
34
  fi
31
35
  }
32
36
 
@@ -26,6 +26,22 @@ The following tasks are meant to help you use the shell more efficiently...
26
26
  %x(cd ~/.dots && git pull origin master)
27
27
  end
28
28
 
29
+ desc :install, "Installs DOTS to ~/.dots and links all of your dotfiles"
30
+ def install
31
+ %x(ln -s #{installation_path} ~/.dots)
32
+
33
+ Dir[File.expand_path("~/.dots/config")].each do |config_file|
34
+ file_name = File.basename config_file
35
+ dot_file = File.expand_path "~/.#{file_name}"
36
+
37
+ if File.exists? dot_file
38
+ say "Skipping #{dot_file} as it already exists. Manually merge and symlink later with `dots persist`."
39
+ else
40
+ %x(ln -s #{config_file} #{dot_file})
41
+ end
42
+ end
43
+ end
44
+
29
45
  desc :version, "Show the current version of DOTS"
30
46
  def version
31
47
  say "DOTS version #{Dots::VERSION} - http://tubbo.github.com/dots"
@@ -1,3 +1,3 @@
1
1
  module Dots
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zsh_dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70310540326480 !ruby/object:Gem::Requirement
16
+ requirement: &70358833531220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70310540326480
24
+ version_requirements: *70358833531220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activemodel
27
- requirement: &70310540326060 !ruby/object:Gem::Requirement
27
+ requirement: &70358833530800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70310540326060
35
+ version_requirements: *70358833530800
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70310540325640 !ruby/object:Gem::Requirement
38
+ requirement: &70358833530380 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70310540325640
46
+ version_requirements: *70358833530380
47
47
  description: DOTS is an advanced ZSH framework.
48
48
  email:
49
49
  - tubbo@psychedeli.ca