zsh_dots 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,15 @@
1
1
  DOTS
2
2
  ====
3
3
 
4
- DOTS is a framework for ZSH that helps you manage your dot-files, ZSH sugar functionality, and your general shell experience. It began its life as a fork off the popular [Oh My ZSH framework][omz]. It has similar design philosophies and functionality, but different goals. Where Oh My ZSH is meant for new users to get more acclamated with ZSH, DOTS is meant for the slightly more advanced user who wants the built-in functionality of Oh My ZSH but wants additional customization and functionality, such as the copying and synchronization of "dot-files".
4
+ DOTS is a framework for ZSH that helps you manage your dot-files, ZSH
5
+ sugar functionality, and your general shell experience. It began its
6
+ life as a fork off the popular [Oh My ZSH framework][omz]. It has
7
+ similar design philosophies and functionality, but different goals.
8
+ Where Oh My ZSH is meant for new users to get more acclamated with ZSH,
9
+ DOTS is meant for the slightly more advanced user who wants the built-in
10
+ functionality of Oh My ZSH but wants a bit more additional
11
+ customization. It also includes some extra tools that help with day-to-day
12
+ shell management tasks.
5
13
 
6
14
  Features
7
15
  --------
@@ -9,19 +17,26 @@ Features
9
17
  - Modular plugin architecture inspired by [Oh My ZSH][omz], but using Antigen for greater efficiency.
10
18
  Only code that's specific to your repo needs to be in your repo.
11
19
  - Simplified prompt string themeing in the `lib/dots/prompt.zsh` directory.
12
- - Configuration persistence via the `persist` command. This copies your dot-files to the **config/**
13
- directory and allows you to optionally store them in Git. Add your persisted configs to your fork's
14
- `.gitignore` if you don't want them synchronized, and `forget` them when you don't want them symlinked
15
- anymore. Keeping your configuration files in a place that's easily accessible with a text editor helps you
16
- keep an eye on your configuration.
20
+ - Configuration persistence via the `persist` command. This copies your
21
+ dot-files to the **config/** directory and allows you to optionally
22
+ store them in Git. Add your persisted configs to your fork's
23
+ `.gitignore` if you don't want them synchronized, and `forget`
24
+ them when you don't want them symlinked anymore. Keeping your
25
+ configuration files in a place that's easily accessible with a
26
+ text editor helps you keep an eye on your configuration.
17
27
  - Aliases for common shell functionality like searching for a running
18
28
  process, opening your text editor, viewing files with a pager, setting
19
29
  the title of the current iTerm tab, [optimizing your OS X environment](osx4h),
20
30
  and much more.
31
+ - Environment boostrapping, installs a global gemset and a series of
32
+ programs through Homebrew (as well as Homebrew itself) that aid in
33
+ your day-to-day programming tasks.
21
34
 
22
35
  Installation
23
36
  ------------
24
37
 
38
+ Unlike Oh My ZSH, DOTS is installed as a gem.
39
+
25
40
  Just run the following commands:
26
41
 
27
42
  ```bash
@@ -81,6 +96,13 @@ sensible defaults, for example `o` will open the current directory, but
81
96
  `o ~/Code` will open up ~/Code in the Finder. `e` follows suit, but `v`
82
97
  throws an error as this should almost never be the case.
83
98
 
99
+ ### dots
100
+
101
+ The DOTS binary is another useful tool in your shell adventures. Invoke
102
+ `dots help` to check out what it does. This binary is most useful for
103
+ updating the DOTS framework from source and bootstrapping the environment
104
+ on new installs.
105
+
84
106
  Hidden Configuration
85
107
  --------------------
86
108
 
@@ -93,34 +115,52 @@ application's dotfile, insert the following line to load configuration
93
115
  from your untracked file:
94
116
 
95
117
  ```bash
96
- . $DOTS/config/file.zsh
118
+ hidden_config_for 'file'
97
119
  ```
98
120
 
99
- Forking
100
- -------
101
-
102
- It's recommended that you fork this project so you can store your own custom settings in **config/**, and get the most use out of this framework.
103
-
104
- To do so, click the **Fork** button at the top of this page.
105
-
106
- Then, type the following into your Terminal:
107
-
108
- git remote add <your-github-username> git@github.com:<your-github-username>/dots.git
109
-
110
- And to make sure it works, type
111
-
112
- git pull <your-github-username> master
113
-
114
- We like the follow the convention for fork names set forth in [the hub plugin][hub] by [Chris Wernstrath][cw]. You can feasibly name the fork anything you like.
121
+ This will run the following shell command:
115
122
 
116
- You can either modify **tools/upgrade.sh** to `git pull` from your fork and `git push` to your fork after the upgrade is complete to keep it in sync, or do it manually by setting `DISABLE_AUTO_UPDATE="true"` (which is disabled by default in **config/zshrc**).
117
-
118
- Usage
119
- -----
120
-
121
- Edit `lib/dots/prompt.zsh` to change your prompt string.
123
+ ```bash
124
+ $ source $DOTS/config/$1.zsh
125
+ ```
122
126
 
123
- Type `persist .vimrc` or `forget .vimrc` to either add or remove your configs to the .dots/ directory, wherein they can then be pushed to your GitHub fork.
127
+ where `$1` is the first argument given to the function.
128
+
129
+ Environment Bootstrapping
130
+ -------------------------
131
+
132
+ DOTS installs a number of programs for you:
133
+
134
+ - **HTTPie** for querying HTTP, and displaying the results in a colorful
135
+ format.
136
+ - **Vim** for text editing. It fits into the DOTS philosophy very nicely
137
+ of having each program do one thing really well.
138
+ - The latest version of the **Ruby** programming language. We believe
139
+ that you should keep your tools up to date, and Homebrew has been
140
+ very reliable in maintaining the latest version of Ruby, as Homebrew
141
+ is itself a Ruby project. It's also a great shell scripting language,
142
+ among other things...
143
+ - **Ruby on Rails**. I'm a Rails developer, so having Rails in the
144
+ global Gemfile is a must. If this offends you, you may kindly remove
145
+ the gem as it isn't really necessary for your use. However, this
146
+ framework is bundled with a number of aliases/plugins for use in Rails
147
+ projects, so I felt like including Rails makes the whole thing
148
+ "complete".
149
+ - **AWS Developer Tools** for interfacing with Amazon Web Services. I
150
+ use AWS to host all of my projects, both at work and at home, and
151
+ these tools make it very easy to get statistics on your instances
152
+ quickly.
153
+ - **Git** is my favorite distributed version control system, and I use
154
+ it on all of my projects, both private and public. DOTS also installs
155
+ a number of plugins for Git that I find useful: **git_tracker** for
156
+ automatically including a Pivotal Tracker issue number in commits
157
+ when your branch follows a specific naming convention, **git-process**
158
+ for managing a strict feature branch-based workflow, and **hub** for
159
+ easy interfacing with Github (allowing you to clone with a simple
160
+ short Github URL: `git clone tubbo/dots`, make pull requests and edit
161
+ them in Vim, define issues, and fork projects). With the exception of
162
+ **hub** all of these gems are completely optional, and must be
163
+ installed explicitly in each new project (as they add Git hooks).
124
164
 
125
165
  License
126
166
  -------
@@ -129,19 +169,33 @@ DOTS is released under **The MIT License**:
129
169
 
130
170
  Copyright (c) 2012 Tom Scott
131
171
 
132
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
133
-
134
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
135
-
136
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
137
-
138
- Contributors
172
+ Permission is hereby granted, free of charge, to any person
173
+ obtaining a copy of this software and associated documentation files
174
+ (the "Software"), to deal in the Software without restriction,
175
+ including without limitation the rights to use, copy, modify, merge,
176
+ publish, distribute, sublicense, and/or sell copies of the Software,
177
+ and to permit persons to whom the Software is furnished to do so,
178
+ subject to the following conditions:
179
+
180
+ The above copyright notice and this permission notice shall be
181
+ included in all copies or substantial portions of the Software.
182
+
183
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
184
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
185
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
186
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
187
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
188
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
189
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
190
+
191
+ Contributing
139
192
  ------------
140
193
 
141
- Just me, [@tubbo][twt]
194
+ To contribute to the project, fork it and send me a pull request!
195
+
196
+ I accept either traditional email pulls or Github pull requests.
142
197
 
143
198
  [omz]: https://github.com/robbyrussell/oh-my-zsh
144
- [twt]: https://twitter.com/tubbo
145
199
  [hub]: https://github.com/defunkt/hub
146
200
  [cw]: https://defunkt.io
147
201
  [osx4h]: https://gist.github.com/2260182
data/config/vimrc CHANGED
@@ -59,7 +59,8 @@ let mapleader = "," " Set leader key to something easier to access
59
59
  "" Whitespace
60
60
  ""
61
61
 
62
- set nowrap " don't wrap lines
62
+ set wrap " turn word wrap on
63
+ set textwidth=72 " attempt to enforce 72 chars
63
64
  set tabstop=2 " a tab is two spaces
64
65
  set shiftwidth=2 " an autoindent (with <<) is two spaces
65
66
  set expandtab " use spaces, not tabs
@@ -164,17 +165,16 @@ augroup vimrcEx
164
165
  " Clear all autocmds in the group
165
166
  autocmd!
166
167
 
167
- " Whenever we're writing text, like comments, make the width mo more
168
- " than 72 characters. This is to ensure maximum readability of
169
- " documentation with things like CTags.
170
- autocmd FileType text setlocal textwidth=72
171
-
172
168
  " Jump to last cursor position unless it's invalid or in an event handler
173
169
  autocmd BufReadPost *
174
170
  \ if line("'\"") > 0 && line("'\"") <= line("$") |
175
171
  \ exe "normal g`\"" |
176
172
  \ endif
177
173
 
174
+ " On the contrary, Haml and HTML files can be uber-long sometimes,
175
+ " so we will ignore wrapping in Haml.
176
+ autocmd FileType haml,html setlocal nowrap
177
+
178
178
  " In Ruby, autoindent with two spaces, always expand tabs
179
179
  autocmd FileType coffee,ruby,haml,eruby,yaml,html,javascript,sass,cucumber set ai sw=2 sts=2 et
180
180
 
@@ -192,12 +192,6 @@ augroup vimrcEx
192
192
  " Standard two-space indentation in CoffeeScript files
193
193
  au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
194
194
 
195
- " Indent <p> tags inherently
196
- "autocmd FileType html,eruby if g:html_indent_tags !~ '\\|p\>' | let g:html_indent_tags .= '\|p\|li\|dt\|dd' | endif
197
-
198
- " Open the README file in a project dir (if there is one)
199
- "autocmd AuNERDTreeCmd VimEnter * call OpenReadme()
200
-
201
195
  " Strip whitespace in Python
202
196
  autocmd BufWritePre *.py :%s/\s\+$//e
203
197
  augroup END
@@ -66,10 +66,6 @@ function tmbundle() {
66
66
  osascript -e 'tell app \"TextMate\" to reload bundles'
67
67
  }
68
68
 
69
- function update_dots() {
70
- dots update > /dev/null
71
- }
72
-
73
69
  # Reload DOTS after a change.
74
70
  function reload_dots() {
75
71
  source $HOME/.zshenv
@@ -88,3 +84,9 @@ function rhombus() {
88
84
  find . -type f -name '._*' -exec rm {} +
89
85
  echo "Removed all ._ files"
90
86
  }
87
+
88
+ # Source a hidden configuration file, usually with the same name as
89
+ # the file it's in, but we set it here explicitly.
90
+ function hidden_config_for() {
91
+ source "$DOTS/config/$1.zsh"
92
+ }
@@ -3,7 +3,8 @@ module Dots
3
3
  include Thor::Actions
4
4
 
5
5
  # These are the programs we are going to download from Homebrew.
6
- PROGRAMS = %w(httpie git ruby)
6
+ PROGRAMS = %w(git ruby python vim pip hub)
7
+ PACKAGES = %w(httpie aws)
7
8
 
8
9
  # Install C binaries, Python programs, and other useful tools
9
10
  # from Homebrew.
@@ -15,8 +16,9 @@ module Dots
15
16
 
16
17
  system "brew install #{programs_to_install}" \
17
18
  unless programs_to_install.empty?
19
+ install_packages
18
20
  else
19
- install_homebrew
21
+ install_homebrew and install_programs
20
22
  end
21
23
  end
22
24
 
@@ -26,6 +28,11 @@ module Dots
26
28
  system "cd #{Dots::HOME} && #{bundle_install}"
27
29
  end
28
30
 
31
+ # Install Python packages from pip. Pip!
32
+ def install_packages
33
+ system "pip install #{PACKAGES.join(' ')}"
34
+ end
35
+
29
36
  private
30
37
  def installed? command
31
38
  `which #{command}` != ""
@@ -9,7 +9,7 @@ module Dots
9
9
 
10
10
  desc :usage, "Show usage information"
11
11
  def usage
12
- say Dots::USAGE_INFORMATION and help
12
+ say Dots.usage_information and help
13
13
  end
14
14
 
15
15
  desc :install, "Copies DOTS to your home directory."
@@ -24,7 +24,7 @@ module Dots
24
24
 
25
25
  desc :version, "Show the current version of DOTS"
26
26
  def version
27
- say "DOTS version #{Dots::VERSION} - http://tubbo.github.com/dots"
27
+ say dots_version
28
28
  end
29
29
 
30
30
  desc :link, "Symlink your ~/.dots/config into dotfiles"
@@ -1,3 +1,3 @@
1
1
  module Dots
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
data/lib/ruby/dots.rb CHANGED
@@ -22,18 +22,19 @@ module Dots
22
22
  @home_dir ||= File.expand_path "~/.dots"
23
23
  end
24
24
 
25
- # Usage information for the DOTS command line tool.
26
- USAGE_INFORMATION = <<-TEXT
25
+ def self.usage_information
26
+ path = "#{Dots.root}/lib/ruby/templates/usage.txt.erb"
27
+ template = ERB.new File.read(path)
27
28
 
28
- The DOTS Project
29
-
30
- DOTS is a ZSH Framework for managing your dotfiles and other shell configuration.
31
- It also gives you some nice, sensible defaults and time-saver aliases to better
32
- work with and understand your shell environment.
33
-
34
- The following tasks are meant to help you use the shell more efficiently...
29
+ template.result(binding)
30
+ end
35
31
 
36
- TEXT
32
+ def self.dots_version
33
+ "DOTS version #{Dots::VERSION} - http://github.com/tubbo/dots"
34
+ end
37
35
 
36
+ def dots_version
37
+ self.dots_version
38
+ end
38
39
  end
39
40
 
@@ -0,0 +1,7 @@
1
+
2
+ <%= dots_version %>
3
+
4
+ DOTS is a ZSH Framework for managing your dotfiles and other shell configuration.
5
+ It also gives you some nice, sensible defaults and time-saver aliases to better
6
+ work with and understand your shell environment.
7
+
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
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -142,6 +142,7 @@ files:
142
142
  - lib/ruby/dots/installer.rb
143
143
  - lib/ruby/dots/persistence.rb
144
144
  - lib/ruby/dots/version.rb
145
+ - lib/ruby/templates/usage.txt.erb
145
146
  - lib/tasks/.gitkeep
146
147
  - spec/integration/command_spec.rb
147
148
  - spec/models/dot_file_spec.rb