From 1faadb4eb0cde1f6198e9d1011a61c7e18d6ac7d Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 13 Jan 2012 02:15:47 -0500 Subject: [PATCH 1/7] added .rbenv-version and .rvmrc to ensure system ruby is used when compiling commandt. --- .rbenv-version | 1 + .rvmrc | 1 + 2 files changed, 2 insertions(+) create mode 100644 .rbenv-version create mode 100644 .rvmrc diff --git a/.rbenv-version b/.rbenv-version new file mode 100644 index 0000000..bec3a35 --- /dev/null +++ b/.rbenv-version @@ -0,0 +1 @@ +system diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 0000000..b12b558 --- /dev/null +++ b/.rvmrc @@ -0,0 +1 @@ +rvm system From c0d8c402c3492ae2abff49e8d16d894dba41e55d Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:34:34 -0500 Subject: [PATCH 2/7] Updated readme with proper git user config. --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5262103..34adbf3 100644 --- a/README.md +++ b/README.md @@ -375,10 +375,15 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl **Put the following in your ~/.secrets file which is automatically referenced by the provided zshrc:** - export GIT_AUTHOR_NAME=yourname - export GIT_AUTHOR_EMAIL=you@domain.com - export GIT_COMITTER_NAME=yourname - export GIT_COMITTER_EMAIL=you@domain.com + # Set your git user info + export GIT_AUTHOR_NAME='You Name' + export GIT_AUTHOR_EMAIL='you@domain.com' + export GIT_COMMITTER_NAME='Your Name' + export GIT_COMMITTER_EMAIL='you@domain.com' + + # Optionally, set your GitHub credentials + export GITHUB_USER='your_user_name' + export GITHUB_TOKEN='your_github_token' **Some of the customizations provided include:** @@ -440,3 +445,4 @@ COMING SOON For more tips and tricks --- Follow my blog: http://yanpritzker.com + From ed5e9069066d1226a2ff227eb1a84a4ce830fdcc Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:42:00 -0500 Subject: [PATCH 3/7] ctags is more compatible with OSX and homebrew. --- bin/run_tags.rb | 14 +++++++++----- vim/plugin/settings/Tlist.vim | 9 ++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/run_tags.rb b/bin/run_tags.rb index 87ef0b9..5c9a651 100755 --- a/bin/run_tags.rb +++ b/bin/run_tags.rb @@ -3,8 +3,12 @@ # A script to run ctags on all .rb files in a project. Can be run on # the current dir, called from a git callback, or install itself as a # git post-merge and post-commit callback. +# More info here: http://vimeo.com/3989493 +# +# This fork will work with homebrew installed ctags on OS X ("brew install ctags") +# Source: https://gist.github.com/1564787 -CTAGS = '/opt/local/bin/ctags' +CTAGS = '/usr/local/bin/ctags' HOOKS = %w{ post-merge post-commit post-checkout } HOOKS_DIR = '.git/hooks' @@ -13,13 +17,13 @@ def install $stderr.print "The install option [-i] can only be used within a git repo; exiting.\n" exit 1 end - + HOOKS.each { |hook| install_hook("#{HOOKS_DIR}/#{hook}") } end def run_tags(dir) if File.executable?(CTAGS) and File.writable?(dir) - %x{find #{dir} -name \\*.rb | #{CTAGS} -e -f #{dir}/TAGS -L - 2>>/dev/null} + %x{find #{dir} -name \\*.rb | #{CTAGS} -f #{dir}/TAGS -L - 2>>/dev/null} else $stderr.print "FAILED to write TAGS file to #{dir}\n" end @@ -30,7 +34,7 @@ def install_hook(hook) $stderr.print "A file already exists at #{hook}, and will NOT be replaced.\n" return end - + print "Linking #{__FILE__} to #{hook}\n" %x{ln -s #{__FILE__} #{hook}} end @@ -40,4 +44,4 @@ if ARGV.first == '-i' else # if GIT_DIR is set, we are being called from git run_tags( ENV['GIT_DIR'] ? "#{ENV['GIT_DIR']}/.." : Dir.pwd ) -end \ No newline at end of file +end diff --git a/vim/plugin/settings/Tlist.vim b/vim/plugin/settings/Tlist.vim index 3ffecdd..d7e066e 100644 --- a/vim/plugin/settings/Tlist.vim +++ b/vim/plugin/settings/Tlist.vim @@ -1,12 +1,12 @@ " set up automatic ctags -let Tlist_Ctags_Cmd='/opt/local/bin/ctags' +let Tlist_Ctags_Cmd='ctags' -" taglist defaults +" taglist defaults let Tlist_Auto_Highlight_Tag=0 let Tlist_Auto_Open=0 let Tlist_Compact_Format = 1 -let Tlist_Exist_OnlyWindow = 1 -let Tlist_WinWidth = 40 +let Tlist_Exist_OnlyWindow = 1 +let Tlist_WinWidth = 40 let Tlist_GainFocus_On_ToggleOpen = 1 let Tlist_Show_Menu = 1 let Tlist_Use_Right_Window = 1 @@ -16,4 +16,3 @@ let Tlist_Show_One_File = 1 let Tlist_Enable_Fold_Column = 0 let Tlist_Display_Prototype = 0 let Tlist_Use_SingleClick = 1 - From 69049330d02124b557084043158bf4e550061566 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:43:20 -0500 Subject: [PATCH 4/7] typo in the readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34adbf3..cd1bec8 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl **Put the following in your ~/.secrets file which is automatically referenced by the provided zshrc:** # Set your git user info - export GIT_AUTHOR_NAME='You Name' + export GIT_AUTHOR_NAME='Your Name' export GIT_AUTHOR_EMAIL='you@domain.com' export GIT_COMMITTER_NAME='Your Name' export GIT_COMMITTER_EMAIL='you@domain.com' From 70ab851fb1aeab6465bc7ced4c5e7d71b13bea01 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:53:58 -0500 Subject: [PATCH 5/7] More README formatting, cleanup, and general tweaks. --- README.md | 151 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index cd1bec8..af9d9f5 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ This is a collection of best of breed tools from across the web, from scouring other people's dotfile repos, blogs, and projects. -What is YADR? ---- + +## What is YADR? **YADR is an opinionated dotfile repo that will make your heart sing** @@ -32,8 +32,8 @@ What is YADR? * **NEW 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** -Why is this not a fork of Janus? ---- + +## 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:** @@ -47,24 +47,26 @@ 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 * 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/lEFlF.png) -Before you start ---- + +## 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 -Installation ---- + +## Installation This project uses git submodules for its plugins, but this is handled for you by the **yadr** command. Please run: + ```bash git clone https://github.com/skwp/dotfiles ~/.dotfiles ~/.dotfiles/bin/yadr/yadr init-plugins + ``` NOTE: by default, YADR will not touch any of your files. You have to manually activate each of its components, if you choose, by following the sections below. @@ -77,8 +79,9 @@ If you pull new changes, be sure to run this to init all the submodules: After you install yadr shell aliases, you can use the *yip* alias to do the same. Please note that init-plugins will automatically compile the CommandT plugin for you. -Setup for ZSH ---- + +### Setup for ZSH + 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). @@ -90,7 +93,9 @@ you just source the _aliases_ file. However, you soul will sing if you install z **Install zsh pain free, automatically:** - wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh + ```bash + curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh + ``` Place this as the last line in your ~/.zshrc created by oh-my-zsh: @@ -113,15 +118,17 @@ mnemonic aliases. Please feel free to edit them: * Bash style ctrl-R for reverse history finder * Fuzzy matching - if you mistype a directory name, tab completion will fix it -Setup for Pry ---- + +### Setup for Pry Pry (http://pry.github.com/) offers a much better out of the box IRB experience with colors, tab completion, and lots of other tricks. You should: + ```bash gem install pry gem install awesome_print ln -s ~/.dotfiles/irb/pryrc ~/.pryrc ln -s ~/.dotfiles/irb/aprc ~/.aprc + ``` **Use pry** @@ -136,19 +143,61 @@ with colors, tab completion, and lots of other tricks. You should: * a few color modifications to make it more useable * type 'help' to see all the commands -Setup for Vim ---- + +### Setup for Git + +**To use the gitconfig (some of the git bash aliases rely on my git aliases)** + + ```bash + ln -s ~/.dotfiles/gitconfig ~/.gitconfig + ``` + +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:** + + # Set your git user info + export GIT_AUTHOR_NAME='Your Name' + export GIT_AUTHOR_EMAIL='you@domain.com' + export GIT_COMMITTER_NAME='Your Name' + export GIT_COMMITTER_EMAIL='you@domain.com' + + # Optionally, set your GitHub credentials + export GITHUB_USER='your_user_name' + export GITHUB_TOKEN='your_github_token' + +**Some of the customizations provided include:** + + * git l - a much more usable git log + * git b - a list of branches with summary of last commit + * git r - a list of remotes with info + * git t - a list of tags with info + * git nb - a (n)ew (b)ranch - like checkout -b + * git cp - cherry-pick -x (showing what was cherrypicked) + * git changelog - a nice format for creating changelogs + * Some sensible default configs, such as improving merge messages, push only pushes the current branch, removing status hints, and using mnemonic prefixes in diff: (i)ndex, (w)ork tree, (c)ommit and (o)bject + * Slightly imrpoved 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 + + +### Setup for Vim + To use the vim files: + ```bash ln -s ~/.dotfiles/vimrc ~/.vimrc ln -s ~/.dotfiles/vim ~/.vim + ``` 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 if you don't like them, or make your own. -Vim Keymaps (in vim/plugin/settings) ---- + +## Vim Configuration + + +### Vim Keymaps (in vim/plugin/settings) 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 @@ -266,14 +315,14 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke * Cmd-/ - toggle comments (usually gcc from tComment) * gcp (comment a paragraph) -Included vim plugins ---- + +### Included vim plugins **Navigation** * NERDTree - everyone's favorite tree browser * NERDTree-tabs - makes NERDTree play nice with MacVim tabs so that it's on every tab - * ShowMarks - creates a visual gutter to the left of the number column showing you your marks + * ShowMarks - creates a visual gutter to the left of the number column showing you your marks * EasyMotion - hit ,,w (forward) or ,,b (back) and watch the magic happen. just type the letters and jump directly to your target - in the provided vimrc the keys are optimized for home and upper row, no pinkies * LustyJuggler/Explorer - hit B, type buf name to match a buffer, or type S and use the home row keys to select a buffer * TagList - hit ,T to see a list of methods in a class (uses ctags) @@ -316,7 +365,7 @@ Included vim plugins * vim-textobj-entire - gives you 'e' for entire document. so vae (visual around entire document), and etc * vim-textobj-rubysymbol - gives you ':' textobj. so va: to select a ruby symbol. da: to delete a symbol..etc * vim-textobj-function - gives you 'f' textobj. so vaf to select a function - * next-textobject - from Steve Losh, ability to use 'n' such as vinb (visual inside (n)ext set of parens) + * next-textobject - from Steve Losh, ability to use 'n' such as vinb (visual inside (n)ext set of parens) **Utils** @@ -347,8 +396,7 @@ Included vim plugins * sass-status - decorates your status bar with full nesting of where you are in the sass file -Adding your own vim plugins ---- +### Adding your own vim plugins YADR comes with a dead simple plugin manager that just uses git submodules, without any fancy config files. @@ -365,41 +413,11 @@ Delete a plugin (Coming Soon) The aliases (yav=yadr vim-add-plugin) and (yuv=yadr vim-update-all-plugins) live in the aliases file. You can then commit the change. It's good to have your own fork of this project to do that. -Setup for Git ---- -**To use the gitconfig (some of the git bash aliases rely on my git aliases)** - ln -s ~/.dotfiles/gitconfig ~/.gitconfig +## Miscellaneous -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:** - - # Set your git user info - export GIT_AUTHOR_NAME='Your Name' - export GIT_AUTHOR_EMAIL='you@domain.com' - export GIT_COMMITTER_NAME='Your Name' - export GIT_COMMITTER_EMAIL='you@domain.com' - - # Optionally, set your GitHub credentials - export GITHUB_USER='your_user_name' - export GITHUB_TOKEN='your_github_token' - -**Some of the customizations provided include:** - - * git l - a much more usable git log - * git b - a list of branches with summary of last commit - * git r - a list of remotes with info - * git t - a list of tags with info - * git nb - a (n)ew (b)ranch - like checkout -b - * git cp - cherry-pick -x (showing what was cherrypicked) - * git changelog - a nice format for creating changelogs - * Some sensible default configs, such as improving merge messages, push only pushes the current branch, removing status hints, and using mnemonic prefixes in diff: (i)ndex, (w)ork tree, (c)ommit and (o)bject - * Slightly imrpoved 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 - -OSX Hacks ---- +### OSX Hacks The osx file is a bash script that sets up sensible defaults for devs and power users under osx. Read through it before running it. To use: @@ -411,15 +429,16 @@ These hacks are Lion-centric. May not work for other OS'es. My favorite mods inc * No disk image verification (downloaded files open quicker) * Display the ~/Library folder in finder (hidden in Lion) -Other recommended OSX tools ---- + +### Other recommended OSX tools + * NValt - Notational Velocity alternative fork - http://brettterpstra.com/project/nvalt/ - syncs with SimpleNote * Vimium for Chrome - vim style browsing. The 'f' to type the two char alias of any link is worth it. * QuickCursor - gives you Apple-Shift-E to edit any OSX text field in vim. * brew install autojump - will track your commonly used directories and let you jump there. With the zsh plugin you can just type 'j [dirspec]', a few letters of the dir you want to go to.]' -Credits ---- + +### Credits I can't take credit for all of this. The vim files are a combination of work by tpope, scrooloose, and many hours of scouring blogs, vimscripts, @@ -437,12 +456,14 @@ and other places for the cream of the crop of vim awesomeness. And everything that's in the modules included in vim/bundle of course. Please explore these people's work. -COMING SOON ---- + +### Comming Soon + * Better isolation of customizations in smaller chunks, maybe as plugins * Automatic setup script to symlink all dotfiles, or just some selectively -For more tips and tricks ---- + +### For more tips and tricks + Follow my blog: http://yanpritzker.com From 2e5474a8e2f54175fb873257f89cafa3d1de8ad0 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:57:56 -0500 Subject: [PATCH 6/7] More README tweaks, formatting for bash commands was wrong. --- README.md | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index af9d9f5..ee35c67 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,10 @@ Remap caps-lock to escape: http://pqrs.org/macosx/keyremap4macbook/extra.html This project uses git submodules for its plugins, but this is handled for you by the **yadr** command. Please run: - ```bash - git clone https://github.com/skwp/dotfiles ~/.dotfiles - ~/.dotfiles/bin/yadr/yadr init-plugins - ``` +```bash +git clone https://github.com/skwp/dotfiles ~/.dotfiles +~/.dotfiles/bin/yadr/yadr init-plugins +``` NOTE: by default, YADR will not touch any of your files. You have to manually activate each of its components, if you choose, by following the sections below. @@ -74,7 +74,9 @@ Eventually these will be automated. If you pull new changes, be sure to run this to init all the submodules: - yadr init-plugins +```bash +yadr init-plugins +``` After you install yadr shell aliases, you can use the *yip* alias to do the same. Please note that init-plugins will automatically compile the CommandT plugin for you. @@ -93,9 +95,9 @@ you just source the _aliases_ file. However, you soul will sing if you install z **Install zsh pain free, automatically:** - ```bash - curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh - ``` +```bash +curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh +``` Place this as the last line in your ~/.zshrc created by oh-my-zsh: @@ -104,7 +106,9 @@ Place this as the last line in your ~/.zshrc created by oh-my-zsh: Or, to make things simpler you can just use the YADR-provided zsh/oh_my_zsh_zshrc Please note that this relies on the skwp fork of oh-my-zsh which contains skwp.theme - ln -sf ~/.dotfiles/zsh/oh_my_zsh_zshrc ~/.zshrc +```bash +ln -sf ~/.dotfiles/zsh/oh_my_zsh_zshrc ~/.zshrc +``` Lots of things I do every day are done with two or three character mnemonic aliases. Please feel free to edit them: @@ -123,12 +127,12 @@ mnemonic aliases. Please feel free to edit them: Pry (http://pry.github.com/) offers a much better out of the box IRB experience with colors, tab completion, and lots of other tricks. You should: - ```bash - gem install pry - gem install awesome_print - ln -s ~/.dotfiles/irb/pryrc ~/.pryrc - ln -s ~/.dotfiles/irb/aprc ~/.aprc - ``` +```bash +gem install pry +gem install awesome_print +ln -s ~/.dotfiles/irb/pryrc ~/.pryrc +ln -s ~/.dotfiles/irb/aprc ~/.aprc +``` **Use pry** @@ -148,9 +152,9 @@ with colors, tab completion, and lots of other tricks. You should: **To use the gitconfig (some of the git bash aliases rely on my git aliases)** - ```bash - ln -s ~/.dotfiles/gitconfig ~/.gitconfig - ``` +```bash +ln -s ~/.dotfiles/gitconfig ~/.gitconfig +``` Since the gitconfig doesn't contain the user info, I recommend using env variables. @@ -184,10 +188,10 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl To use the vim files: - ```bash - ln -s ~/.dotfiles/vimrc ~/.vimrc - ln -s ~/.dotfiles/vim ~/.vim - ``` +```bash +ln -s ~/.dotfiles/vimrc ~/.vimrc +ln -s ~/.dotfiles/vim ~/.vim +``` 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 From 25e096dfe3fab06035675b08e604e931ad162368 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 14:21:46 -0500 Subject: [PATCH 7/7] Remove Taglist settings. --- vim/plugin/settings/Tlist.vim | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 vim/plugin/settings/Tlist.vim diff --git a/vim/plugin/settings/Tlist.vim b/vim/plugin/settings/Tlist.vim deleted file mode 100644 index d7e066e..0000000 --- a/vim/plugin/settings/Tlist.vim +++ /dev/null @@ -1,18 +0,0 @@ -" set up automatic ctags -let Tlist_Ctags_Cmd='ctags' - -" taglist defaults -let Tlist_Auto_Highlight_Tag=0 -let Tlist_Auto_Open=0 -let Tlist_Compact_Format = 1 -let Tlist_Exist_OnlyWindow = 1 -let Tlist_WinWidth = 40 -let Tlist_GainFocus_On_ToggleOpen = 1 -let Tlist_Show_Menu = 1 -let Tlist_Use_Right_Window = 1 -let Tlist_Use_Horiz_Window = 0 -let Tlist_Close_On_Select = 1 -let Tlist_Show_One_File = 1 -let Tlist_Enable_Fold_Column = 0 -let Tlist_Display_Prototype = 0 -let Tlist_Use_SingleClick = 1