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 +39 -15
- data/config/zshenv +1 -0
- data/lib/dots/aliases.zsh +1 -1
- data/lib/dots/functions.zsh +9 -5
- data/lib/ruby/dots/command.rb +16 -0
- data/lib/ruby/dots/version.rb +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -22,21 +22,16 @@ Features
|
|
22
22
|
Installation
|
23
23
|
------------
|
24
24
|
|
25
|
-
|
25
|
+
Just run the following commands:
|
26
26
|
|
27
|
-
|
27
|
+
```bash
|
28
|
+
$ gem install zsh_dots
|
29
|
+
$ dots install
|
30
|
+
```
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
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
|
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
|
|
data/config/zshenv
CHANGED
data/lib/dots/aliases.zsh
CHANGED
data/lib/dots/functions.zsh
CHANGED
@@ -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 [[
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
33
|
+
$EDITOR
|
30
34
|
fi
|
31
35
|
}
|
32
36
|
|
data/lib/ruby/dots/command.rb
CHANGED
@@ -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"
|
data/lib/ruby/dots/version.rb
CHANGED
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.
|
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: &
|
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: *
|
24
|
+
version_requirements: *70358833531220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activemodel
|
27
|
-
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: *
|
35
|
+
version_requirements: *70358833530800
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
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: *
|
46
|
+
version_requirements: *70358833530380
|
47
47
|
description: DOTS is an advanced ZSH framework.
|
48
48
|
email:
|
49
49
|
- tubbo@psychedeli.ca
|