Simplify install: Move font, homebrew installation into rake installer
This commit is contained in:
parent
6c0f02dd3f
commit
c85c25ff3b
22
README-pry.md
Normal file
22
README-pry.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
### Install the gem
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gem install pry
|
||||||
|
gem install pry-nav
|
||||||
|
gem install awesome_print
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use pry
|
||||||
|
|
||||||
|
* as irb: `pry`
|
||||||
|
* as rails console: `script/console --irb=pry`
|
||||||
|
* as a debugger: `require 'pry'; binding.pry` in your code (or just type `pry!<space>` to make vim do it)
|
||||||
|
|
||||||
|
### Pry Customizations:
|
||||||
|
|
||||||
|
* `clear` command to clear screen
|
||||||
|
* `sql` command to execute something (within a rails console)
|
||||||
|
* `c` (continue) `n` (next) `s` (step) commands for debugging using pry-nav
|
||||||
|
* all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print
|
||||||
|
* a few color modifications to make it more useable
|
||||||
|
* type `help` to see all the commands
|
190
README.md
190
README.md
@ -11,10 +11,6 @@
|
|||||||
git clone https://github.com/skwp/dotfiles ~/.yadr
|
git clone https://github.com/skwp/dotfiles ~/.yadr
|
||||||
cd ~/.yadr && rake install
|
cd ~/.yadr && rake install
|
||||||
|
|
||||||
# Your dotfiles are safe! YADR will not
|
|
||||||
# overwrite anything. Please read on for
|
|
||||||
# install directions!
|
|
||||||
|
|
||||||
This is a collection of best of breed tools from across the web,
|
This is a collection of best of breed tools from across the web,
|
||||||
from scouring other people's dotfile repos, blogs, and projects.
|
from scouring other people's dotfile repos, blogs, and projects.
|
||||||
|
|
||||||
@ -28,17 +24,9 @@ from scouring other people's dotfile repos, blogs, and projects.
|
|||||||
* Avoid stressful hand motions, e.g. remap Esc to caps lock key, remap underscore to Alt-k in vim, make window management in vim easy.
|
* Avoid stressful hand motions, e.g. remap Esc to caps lock key, remap underscore to Alt-k in vim, make window management in vim easy.
|
||||||
* Easy to use plugin architecture, no config files to edit.
|
* Easy to use plugin architecture, no config files to edit.
|
||||||
* Pick one tool and use it everywhere: vim-ize everything
|
* Pick one tool and use it everywhere: vim-ize everything
|
||||||
* **NEW Beautiful, easy to read and small vimrc**
|
* Beautiful, easy to read and small vimrc**
|
||||||
* **NEW No key overrides or custom hackery in vimrc, everything in well factored snippets in .vim/plugin/settings**
|
* No key overrides or custom hackery in vimrc, everything in well factored snippets in .vim/plugin/settings**
|
||||||
|
* Much larger list of vim plugins than Janus, specifically geared to Ruby/Rails/Git development.
|
||||||
|
|
||||||
## Why is this not a fork of Janus?
|
|
||||||
Janus is an amazing _first effort_ to deliver a ready-to-use vim setup and is a huge inspiration to us all.
|
|
||||||
|
|
||||||
**However as any first effort, it paves the way to improvements:**
|
|
||||||
|
|
||||||
* Much larger list of vim plugins, specifically geared to Ruby/Rails/Git development.
|
|
||||||
* Optimized support for MacVim only means less things will break because we don't worry about linux or gvim.
|
|
||||||
* Optimized support for Solarized color scheme only, everything guaranteed to Look Good. Your eyes will thank you.
|
* Optimized support for Solarized color scheme only, everything guaranteed to Look Good. Your eyes will thank you.
|
||||||
* All plugins tested with Solarized and custom color maps provided where needed to ensure your eyes will not bleed.
|
* All plugins tested with Solarized and custom color maps provided where needed to ensure your eyes will not bleed.
|
||||||
* No configuration file to maintain. YADR uses tiny ruby scripts to wrap git submodule maintenance.
|
* No configuration file to maintain. YADR uses tiny ruby scripts to wrap git submodule maintenance.
|
||||||
@ -46,79 +34,10 @@ Janus is an amazing _first effort_ to deliver a ready-to-use vim setup and is a
|
|||||||
* All keymaps and customization in small, easy to maintain files under .vim/plugin/settings
|
* All keymaps and customization in small, easy to maintain files under .vim/plugin/settings
|
||||||
* More than just vim plugins - great shell aliases, osx, and irb/pry tweaks to make you more productive.
|
* More than just vim plugins - great shell aliases, osx, and irb/pry tweaks to make you more productive.
|
||||||
|
|
||||||
|
|
||||||
## Screenshot
|
## Screenshot
|
||||||
![screenshot](http://i.imgur.com/afzuR.png)
|
![screenshot](http://i.imgur.com/afzuR.png)
|
||||||
|
|
||||||
|
# Installation
|
||||||
## Before you start
|
|
||||||
|
|
||||||
For the love of all that is holy, stop abusing your hands!
|
|
||||||
Remap caps-lock to escape: http://pqrs.org/macosx/keyremap4macbook/extra.html
|
|
||||||
|
|
||||||
## Debugging vim keymappings
|
|
||||||
|
|
||||||
This is so useful, it needs to be at the top. If you are having unexpected behavior, wondering why a particular key works the way it does,
|
|
||||||
use: `:map [keycombo]` (e.g. `:map <C-\>`) to see what the key is mapped to. For bonus points, you can see where the mapping was set by using `:verbose map [keycombo]`.
|
|
||||||
If you omit the key combo, you'll get a list of all the maps. You can do the same thing with nmap, imap, vmap, etc.
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
YADR is opinionated. To get the most out of using it, you should install
|
|
||||||
all the software it depends on.
|
|
||||||
|
|
||||||
### Patched fonts for Vim-Powerline
|
|
||||||
|
|
||||||
Please install fonts from fonts/ directory. These are used to give a really nice vim status line.
|
|
||||||
|
|
||||||
### [Homebrew](http://mxcl.github.com/homebrew/)
|
|
||||||
|
|
||||||
Homebrew is _the missing package manager for OSX_. To install:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
/usr/bin/ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
|
|
||||||
```
|
|
||||||
|
|
||||||
With homebrew installed, install some packages:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
brew install ack ctags git hub macvim
|
|
||||||
```
|
|
||||||
|
|
||||||
### Ruby Debugger
|
|
||||||
|
|
||||||
This gem is used to give you visual IDE-style debugging within vim, combined
|
|
||||||
with the vim-ruby-debugger plugin:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gem install ruby-debug-ide
|
|
||||||
```
|
|
||||||
|
|
||||||
### [ctags](http://ctags.sourceforge.net/)
|
|
||||||
|
|
||||||
Vim will complain every time you save a file if you do not have ctags installed correctly. We
|
|
||||||
assume you have installed ctags via homebrew. If you have homebrew setup correctly running
|
|
||||||
`which ctags` should output `/usr/local/bin/ctags`. If you get something else do this:
|
|
||||||
|
|
||||||
Make sure `/usr/local/bin` is before `/usr/bin` in your PATH.
|
|
||||||
|
|
||||||
If that doesn't work, move the OSX supplied ctags [like so](http://www.mattpolito.info/post/1648956809/ctags-got-you-down):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo mv /usr/bin/ctags /usr/bin/ctags_original
|
|
||||||
```
|
|
||||||
|
|
||||||
### [fasd](https://github.com/clvv/fasd)
|
|
||||||
|
|
||||||
fasd gives you handy shell commands `f`,`a`,`s`,`d`, and `z` to jump to recently used files.
|
|
||||||
|
|
||||||
Read more at the project's home page. Or just type `z` followed by a partial reference to
|
|
||||||
a recent directory to see how it works.
|
|
||||||
|
|
||||||
fasd is currently shipped with yadr in the bin directory.
|
|
||||||
In the future it will be included as a submodule.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Installation is automated via `rake` and the `yadr` command. To get
|
Installation is automated via `rake` and the `yadr` command. To get
|
||||||
started please run:
|
started please run:
|
||||||
@ -128,13 +47,9 @@ git clone https://github.com/skwp/dotfiles ~/.yadr
|
|||||||
cd ~/.yadr && rake install
|
cd ~/.yadr && rake install
|
||||||
```
|
```
|
||||||
|
|
||||||
Open the fonts in fonts/ and click Install Font for every font that you want.
|
|
||||||
You must install Inconsolata to have YADR's powerline theme work correctly out of the box.
|
|
||||||
|
|
||||||
Note: YADR will not destroy any of your files unless you tell it to.
|
Note: YADR will not destroy any of your files unless you tell it to.
|
||||||
|
|
||||||
|
### Upgrading
|
||||||
## Upgrading
|
|
||||||
|
|
||||||
Upgrading is easy.
|
Upgrading is easy.
|
||||||
|
|
||||||
@ -144,8 +59,39 @@ git pull origin master
|
|||||||
rake install
|
rake install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# What's included, and how to customize?
|
||||||
|
|
||||||
## ZSH
|
Read on to learn what YADR provides!
|
||||||
|
|
||||||
|
## Public service announcement: stop abusing your hands!
|
||||||
|
|
||||||
|
[Remap caps-lock to escape](http://pqrs.org/macosx/keyremap4macbook/extra.html)
|
||||||
|
|
||||||
|
The escape key is the single most used key in vim.
|
||||||
|
Old keyboards used to have Ctrl where caps lock is today. But it's even better if you put escape there.
|
||||||
|
If you're hitting a small target in the corner, you are slowing yourself down considerably, and probably damaging your hands with repetitive strain injuries.
|
||||||
|
|
||||||
|
### [Homebrew](http://mxcl.github.com/homebrew/)
|
||||||
|
|
||||||
|
Homebrew is _the missing package manager for OSX_. Installed automatically.
|
||||||
|
|
||||||
|
We automatically install a few useful packages including ack, ctags, git, and hub
|
||||||
|
You can install macvim from brew as well, or download it from their website.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install ack ctags git hub macvim
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ruby Debugger
|
||||||
|
|
||||||
|
This gem is optonal and not included. It's used to give you visual IDE-style debugging within vim, combined
|
||||||
|
with the vim-ruby-debugger plugin. To install:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gem install ruby-debug-ide
|
||||||
|
```
|
||||||
|
|
||||||
|
### ZSH
|
||||||
|
|
||||||
After a lifetime of bash, I am now using ZSH as my default shell because of its awesome globbing
|
After a lifetime of bash, I am now using ZSH as my default shell because of its awesome globbing
|
||||||
and autocomplete features (the spelling fixer autocomplete is worth the money alone).
|
and autocomplete features (the spelling fixer autocomplete is worth the money alone).
|
||||||
@ -161,7 +107,7 @@ mnemonic aliases. Please feel free to edit them:
|
|||||||
|
|
||||||
### [Prezto](https://github.com/sorin-ionescu/prezto)
|
### [Prezto](https://github.com/sorin-ionescu/prezto)
|
||||||
|
|
||||||
For a more complete Zsh experience we use **[Prezto](http://github.com/sorin-ionescu/prezto)**.
|
For a more complete Zsh experience we use **[Prezto](http://github.com/sorin-ionescu/prezto)**.
|
||||||
Prezto is included as a submodule.
|
Prezto is included as a submodule.
|
||||||
|
|
||||||
### Adding your own ZSH theme
|
### Adding your own ZSH theme
|
||||||
@ -189,48 +135,23 @@ echo "prompt skwp" > ~/.zsh.after/prompt.zsh
|
|||||||
|
|
||||||
Next time you load your shell, this file will be read and your prompt will be the skwp prompt. Use `prompt -l` to see the available prompts.
|
Next time you load your shell, this file will be read and your prompt will be the skwp prompt. Use `prompt -l` to see the available prompts.
|
||||||
|
|
||||||
### ZSH Customizations
|
### Included ZSH Customizations
|
||||||
|
|
||||||
* Vim mode
|
* Vim mode
|
||||||
* Bash style ctrl-R for reverse history finder
|
* Bash style ctrl-R for reverse history finder
|
||||||
* Ctrl-x,Ctrl-l to insert output of last command
|
* Ctrl-x,Ctrl-l to insert output of last command
|
||||||
* Fuzzy matching - if you mistype a directory name, tab completion will fix it
|
* Fuzzy matching - if you mistype a directory name, tab completion will fix it
|
||||||
|
* [fasd](https://github.com/clvv/fasd) integration - hit `z` and partial match for recently used directory. Tab completion enabled.
|
||||||
|
* Syntax highlighting as you type commands
|
||||||
|
* Lots more!
|
||||||
|
|
||||||
## Pry
|
### [Pry](http://pry.github.com/)
|
||||||
|
Pry offers a much better out of the box IRB experience with colors, tab completion, and lots of other tricks. You can also use it
|
||||||
|
as an actual debugger on MRI 1.9.2+ by installing [pry-debugger](https://github.com/nixme/pry-debugger).
|
||||||
|
|
||||||
Pry (http://pry.github.com/) offers a much better out of the box IRB experience
|
[Learn more about YADR's pry customizations and how to install](https://github.com/skwp/dotfiles/blob/master/README-pry.md)
|
||||||
with colors, tab completion, and lots of other tricks. You can also use it
|
|
||||||
as an actual debugger by installing pry-nav (https://github.com/nixme/pry-nav) to
|
|
||||||
get colorized debugging that shows you where you are as you step through.
|
|
||||||
|
|
||||||
You should:
|
### Git User Info
|
||||||
|
|
||||||
### Install the gem
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gem install pry
|
|
||||||
gem install pry-nav
|
|
||||||
gem install awesome_print
|
|
||||||
```
|
|
||||||
|
|
||||||
### Use pry
|
|
||||||
|
|
||||||
* as irb: `pry`
|
|
||||||
* as rails console: `script/console --irb=pry`
|
|
||||||
* as a debugger: `require 'pry'; binding.pry` in your code (or just type `pry!<space>` to make vim do it)
|
|
||||||
|
|
||||||
### Pry Customizations:
|
|
||||||
|
|
||||||
* `clear` command to clear screen
|
|
||||||
* `sql` command to execute something (within a rails console)
|
|
||||||
* `c` (continue) `n` (next) `s` (step) commands for debugging using pry-nav
|
|
||||||
* all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print
|
|
||||||
* a few color modifications to make it more useable
|
|
||||||
* type `help` to see all the commands
|
|
||||||
|
|
||||||
## Git
|
|
||||||
|
|
||||||
### User Info
|
|
||||||
|
|
||||||
Since the gitconfig doesn't contain the user info, I recommend using env variables. Put the following in
|
Since the gitconfig doesn't contain the user info, I recommend using env variables. Put the following in
|
||||||
your `~/.secrets` file which is automatically referenced by the provided zshrc:
|
your `~/.secrets` file which is automatically referenced by the provided zshrc:
|
||||||
@ -258,16 +179,16 @@ your `~/.secrets` file which is automatically referenced by the provided zshrc:
|
|||||||
* Slightly improved colors for diff
|
* Slightly improved colors for diff
|
||||||
* `git unstage` (remove from index) and `git uncommit` (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
* `git unstage` (remove from index) and `git uncommit` (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
||||||
|
|
||||||
## RubyGems
|
### RubyGems
|
||||||
|
|
||||||
A .gemrc is included. Never again type `gem install whatever --no-ri --no-rdoc`. `--no-ri --no-rdoc` is done by default.
|
A .gemrc is included. Never again type `gem install whatever --no-ri --no-rdoc`. `--no-ri --no-rdoc` is done by default.
|
||||||
|
|
||||||
## Vimization of everything
|
### Vimization of everything
|
||||||
|
|
||||||
The provided inputrc and editrc will turn your various command line tools like mysql and irb into vim prompts. There's
|
The provided inputrc and editrc will turn your various command line tools like mysql and irb into vim prompts. There's
|
||||||
also an included Ctrl-R reverse history search feature in editrc, very useful in irb.
|
also an included Ctrl-R reverse history search feature in editrc, very useful in irb.
|
||||||
|
|
||||||
## Vim Configuration
|
### Vim Configuration
|
||||||
|
|
||||||
The .vimrc is well commented and broken up by settings. I encourage you
|
The .vimrc is well commented and broken up by settings. I encourage you
|
||||||
to take a look and learn some of my handy aliases, or comment them out
|
to take a look and learn some of my handy aliases, or comment them out
|
||||||
@ -280,6 +201,13 @@ The files in vim/plugin/settings are customizations stored on a per-plugin
|
|||||||
basis. The main keymap is available in skwp-keymap.vim, but some of the vim
|
basis. The main keymap is available in skwp-keymap.vim, but some of the vim
|
||||||
files contain key mappings as well (TODO: probably will move them out to skwp-keymap.vim)
|
files contain key mappings as well (TODO: probably will move them out to skwp-keymap.vim)
|
||||||
|
|
||||||
|
### Debugging vim keymappings
|
||||||
|
|
||||||
|
If you are having unexpected behavior, wondering why a particular key works the way it does,
|
||||||
|
use: `:map [keycombo]` (e.g. `:map <C-\>`) to see what the key is mapped to. For bonus points, you can see where the mapping was set by using `:verbose map [keycombo]`.
|
||||||
|
If you omit the key combo, you'll get a list of all the maps. You can do the same thing with nmap, imap, vmap, etc.
|
||||||
|
|
||||||
|
|
||||||
#### Navigation
|
#### Navigation
|
||||||
|
|
||||||
* `,z` - go to previous buffer (:bp)
|
* `,z` - go to previous buffer (:bp)
|
||||||
@ -444,7 +372,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
|||||||
* AnsiEsc - inteprets ansi color codes inside log files. great for looking at Rails logs
|
* AnsiEsc - inteprets ansi color codes inside log files. great for looking at Rails logs
|
||||||
* solarized - a color scheme scientifically calibrated for awesomeness (including skwp mods for ShowMarks)
|
* solarized - a color scheme scientifically calibrated for awesomeness (including skwp mods for ShowMarks)
|
||||||
* csapprox - helps colors to be represented correctly on terminals (even though we expect to use MacVim)
|
* csapprox - helps colors to be represented correctly on terminals (even though we expect to use MacVim)
|
||||||
* Powerline - beautiful vim status bar. Requires patched fonts (install from fonts/ directory)
|
* Powerline - beautiful vim status bar. Requires patched fonts (installed from fonts/ directory)
|
||||||
|
|
||||||
#### Coding
|
#### Coding
|
||||||
|
|
||||||
@ -509,7 +437,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
|
|||||||
|
|
||||||
### Overriding vim settings
|
### Overriding vim settings
|
||||||
|
|
||||||
You may use `~/.vimrc.before` for settings like the __leader__ setting.
|
You may use `~/.vimrc.before` for settings like the __leader__ setting.
|
||||||
You may `~/.vimrc.after` (for those transitioning from janus) or in `~/.yadr/vim/after/.vimrc.after` for any additional overrides/settings.
|
You may `~/.vimrc.after` (for those transitioning from janus) or in `~/.yadr/vim/after/.vimrc.after` for any additional overrides/settings.
|
||||||
If you didn't have janus before, it is recommended to just put it in `~/.yadr/vim/after` so you can better manage your overrides.
|
If you didn't have janus before, it is recommended to just put it in `~/.yadr/vim/after` so you can better manage your overrides.
|
||||||
|
|
||||||
|
33
Rakefile
33
Rakefile
@ -9,6 +9,9 @@ task :install => [:submodules] do
|
|||||||
puts "be overwritten without your consent."
|
puts "be overwritten without your consent."
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts
|
puts
|
||||||
|
|
||||||
|
install_homebrew
|
||||||
|
|
||||||
# this has all the runcoms from this directory.
|
# this has all the runcoms from this directory.
|
||||||
file_operation(Dir.glob('git/*')) if want_to_install?('git configs (color, aliases)')
|
file_operation(Dir.glob('git/*')) if want_to_install?('git configs (color, aliases)')
|
||||||
file_operation(Dir.glob('irb/*')) if want_to_install?('irb/pry configs (more colorful)')
|
file_operation(Dir.glob('irb/*')) if want_to_install?('irb/pry configs (more colorful)')
|
||||||
@ -21,12 +24,18 @@ task :install => [:submodules] do
|
|||||||
install_prezto
|
install_prezto
|
||||||
end
|
end
|
||||||
|
|
||||||
|
install_fonts
|
||||||
|
|
||||||
success_msg("installed")
|
success_msg("installed")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Init and update submodules."
|
desc "Init and update submodules."
|
||||||
task :submodules do
|
task :submodules do
|
||||||
|
puts "======================================================"
|
||||||
|
puts "Downloading YADR submodules...please wait"
|
||||||
|
puts "======================================================"
|
||||||
sh('git submodule update --init --recursive')
|
sh('git submodule update --init --recursive')
|
||||||
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
task :default => 'install'
|
task :default => 'install'
|
||||||
@ -39,6 +48,30 @@ def run(cmd)
|
|||||||
`#{cmd}` unless ENV['DEBUG']
|
`#{cmd}` unless ENV['DEBUG']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def install_homebrew
|
||||||
|
puts "======================================================"
|
||||||
|
puts "Installing Homebrew, the OSX package manager...If it's"
|
||||||
|
puts "already installed, this will do nothing."
|
||||||
|
puts "======================================================"
|
||||||
|
run %{ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"}
|
||||||
|
puts
|
||||||
|
puts
|
||||||
|
puts "======================================================"
|
||||||
|
puts "Installing Homebrew packages...There may be some warnings."
|
||||||
|
puts "======================================================"
|
||||||
|
run %{brew install ack ctags git hub}
|
||||||
|
puts
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
|
||||||
|
def install_fonts
|
||||||
|
puts "======================================================"
|
||||||
|
puts "Installing patched fonts for Powerline."
|
||||||
|
puts "======================================================"
|
||||||
|
run %{ cp -f $HOME/.yadr/fonts/* $HOME/Library/Fonts }
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
|
||||||
def install_prezto
|
def install_prezto
|
||||||
puts "Installing Prezto (ZSH Enhancements)..."
|
puts "Installing Prezto (ZSH Enhancements)..."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user