Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (56 commits)
  Add jsx bundle
  Remove zr alias conflicting with zeus rspec
  Fix zeus alias
  Run tests using zeus with zl and zs
  Add zeus aliases
  Fix typo: "postres" -> "postgres"
  Add command to delete already merged branches
  Ctrl-x and Ctrl-z navigate the quickfix list
  Update ctrlp [Fix skwp#645]
  Fixed a typo
  Allow ts alias to use a specific VM_IP
  More secure alias for starting thin client on localhost only
  Unmap gf..causing issues
  Updated vimrc
  Update prezto to point to master
  Unmap ctrl-f which overrides normal vim behavior
  Install prezto via symlink [Fix skwp#624]
  Add css/sass/less for ctags
  Rename poorly named method in rakefile
  Auto indent pasted text in vim
  ...
  • Loading branch information
burnettk committed Jan 25, 2016
2 parents 755abaa + 6ab2d71 commit 715047a
Show file tree
Hide file tree
Showing 30 changed files with 160 additions and 105 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
2015-10-27
==================
* Support for running zeus commands for rspec (`zl` and `zr`)
* Ctrl-x and Ctrl-z to navigate the quickfix list

2014-06-01
==================
* Change Cmd-Space to Ctrl-Space for vim autocomplete so it doesn't conflict with osx spotlight by default, and so there are no additional steps to install.

2014-02-15
==================
Expand Down
44 changes: 32 additions & 12 deletions README.md
Expand Up @@ -13,8 +13,10 @@ version control.
# Yet Another Dotfile Repo v1.1
# Now with Prezto and Vundle!

sh -c "`curl -fsSL https://raw.github.com/skwp/dotfiles/master/install.sh`" # install skwp's dotfiles
sh -c "`curl -fsSL https://raw.github.com/burnettk/dotfiles/master/install.sh`" # install burnettk's fork
[![Join the chat at https://gitter.im/skwp/dotfiles](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/skwp/dotfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

sh -c "`curl -fsSL https://raw.githubusercontent.com/skwp/dotfiles/master/install.sh`" # install skwp's dotfiles
sh -c "`curl -fsSL https://raw.githubusercontent.com/burnettk/dotfiles/master/install.sh`" # install burnettk's fork

**Always be sure to run `rake update` after pulling to ensure plugins are updated**

Expand All @@ -25,7 +27,7 @@ version control.
* The best bits of all the top dotfile repos, vim and zsh plugins curated in one place, into a simple and cohesive way of working.
* More than 90 vim plugins, all under one roof, working together, each plugin researched and configured to be at its best, often with better shortcut keys.
* Many zsh plugins, starting with the wonderful Prezto base, and adding a few niceties on top.
* All things are vimized: irb, postres command line, etc.
* All things are vimized: irb, postgres command line, etc.

## Mailing List

Expand All @@ -42,23 +44,32 @@ Please use GitHub Issues for pull requests or bug reports only.
To get started please run:

```bash
sh -c "`curl -fsSL https://raw.github.com/skwp/dotfiles/master/install.sh`"
sh -c "`curl -fsSL https://raw.githubusercontent.com/skwp/dotfiles/master/install.sh`"
```

**Note:** YADR will automatically install all of its subcomponents. If you want to be asked
about each one, use:

```bash
sh -c "`curl -fsSL https://raw.github.com/skwp/dotfiles/master/install.sh`" -s ask
sh -c "`curl -fsSL https://raw.githubusercontent.com/skwp/dotfiles/master/install.sh`" -s ask
```

## Wait, you're not done! Do this:

* **Install iTerm Solarized Colors** - YADR will install Solarized colorschemes into your iTerm. Go to Profiles => Colors => Load Presets to pick Solarized Dark.
* [Remap caps-lock to escape with PCKeyboardHack](http://pqrs.org/macosx/keyremap4macbook/pckeyboardhack.html) - The escape key is the single most used key in vim. Old keyboards used to have Escape where Tab is today. Apple keyboards are the worst with their tiny Esc keys. But all this is fixed by remapping Caps to Escape. 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.
* Remap your Alfred or Spotlight to `Ctrl-Cmd-Space`, so that you can use `Cmd-Space` to autocomplete in vim. This is much more friendly for your fingers than `Ctrl-n`.
* Set up a system wide hotkey for iTerm (Keys=>Hotkey). Recommended Cmd-Escape, which is really Cmd-Capslock.
* In iTerm, uncheck "Use Lion-style full screen" on General; in MacVim, uncheck Prefer native fullscreen under Advanced settings. This will give you fast full screen windows that are switchable without switching to spaces.
#### Install iTerm Solarized Colors
YADR will install Solarized colorschemes into your iTerm. Go to Profiles => Colors => Load Presets to pick Solarized Dark.

#### Remap caps-lock to escape with [Seil](https://pqrs.org/osx/karabiner/seil.html.en)
The escape key is the single most used key in vim. Old keyboards used to have Escape where Tab is today. Apple keyboards are the worst with their tiny Esc keys. But all this is fixed by remapping Caps to Escape. 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.

#### Set up a system wide hotkey for iTerm (Keys=>Hotkey)
Recommended Cmd-Escape, which is really Cmd-Capslock.

#### In iTerm, uncheck "Use Lion-style full screen" on General
This will give you fast full screen windows that are switchable without switching to spaces.

#### in MacVim, uncheck Prefer native fullscreen under Advanced settings
Same as iTerm. The Lion style spaces navigation slows everything down for no reason.

## If you want to run vim in terminal

Expand All @@ -71,6 +82,7 @@ sh -c "`curl -fsSL https://raw.github.com/skwp/dotfiles/master/install.sh`" -s a
* If you want to use an alternate colorcheme like Gruvbox, then in your `~/.vimrc.after` do:

let g:yadr_disable_solarized_enhancements = 1
colorscheme base16-twilight

### Upgrading

Expand Down Expand Up @@ -132,6 +144,7 @@ It is recommended to use this file to set your user info. Alternately, you can s
* `git unstage` / `guns` (remove from index) and `git uncommit` / `gunc` (revert to the time prior to the last commit - dangerous if already pushed) aliases
* 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 improved colors for diff
* `gdmb` (g)it (d)elete (m)erged (b)ranches - Deletes all branches already merged on current branch

### RubyGems

Expand Down Expand Up @@ -187,7 +200,6 @@ of plugins above to learn more.
* `,gd` - Grep def (greps for 'def [function name]') when cursor is over the function name
* `,gcf` - Grep Current File to find references to the current file
* `//` - clear the search
* `,T` - Tag list (list of methods in a class)
* `,,w` (alias `,<esc>`) or `,,b` (alias `,<shift-esc>`) - EasyMotion, a vimperator style tool that highlights jump-points on the screen and lets you type to get there.
* `,mc` - mark this word for MultiCursor (like sublime). Use `Ctrl-n` (next), `Ctrl-p` (prev), `Ctrl-x`(skip) to add more cursors, then do normal vim things like edit the word.
* `gK` - Opens the documentation for the word under the cursor.
Expand All @@ -205,7 +217,7 @@ of plugins above to learn more.

#### Better keystrokes for common editing commands

* Cmd-Space to autocomplete. Tab for snipmate snippets.
* Ctrl-Space to autocomplete. Tab for snipmate snippets.
* `,#` `,"` `,'` `,]` `,)` `,}` to surround a word in these common wrappers. the # does #{ruby interpolation}. works in visual mode (thanks @cj). Normally these are done with something like `ysw#`
* `Cmd-'`, `Cmd-"`, `Cmd-]`, `Cmd-)`, etc to change content inside those surrounding marks. You don't have to be inside them (`Alt` in Linux)
* `,.` to go to last edit location (same as `'.`) because the apostrophe is hard on the pinky
Expand Down Expand Up @@ -297,6 +309,14 @@ brew cleanup
brew install macvim --custom-icons --override-system-vim --with-lua --with-luajit
```

### Terminal Vim troubles with Lua?
Installing terminal vim (with lua) with an RVM managed Ruby can cause the neocomplete plugin to segfault. Try uninstalling vim, then installing with system ruby:

```
brew uninstall vim
rvm system do brew install vim --with-lua
```


### [Pry](http://pry.github.com/)

Expand Down
23 changes: 12 additions & 11 deletions Rakefile
Expand Up @@ -14,14 +14,14 @@ task :install => [:submodule_init, :submodules] do
install_rvm_binstubs

# 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('irb/*')) if want_to_install?('irb/pry configs (more colorful)')
file_operation(Dir.glob('ruby/*')) if want_to_install?('rubygems config (faster/no docs)')
file_operation(Dir.glob('ctags/*')) if want_to_install?('ctags config (better js/ruby support)')
file_operation(Dir.glob('tmux/*')) if want_to_install?('tmux config')
file_operation(Dir.glob('vimify/*')) if want_to_install?('vimification of command line tools')
install_files(Dir.glob('git/*')) if want_to_install?('git configs (color, aliases)')
install_files(Dir.glob('irb/*')) if want_to_install?('irb/pry configs (more colorful)')
install_files(Dir.glob('ruby/*')) if want_to_install?('rubygems config (faster/no docs)')
install_files(Dir.glob('ctags/*')) if want_to_install?('ctags config (better js/ruby support)')
install_files(Dir.glob('tmux/*')) if want_to_install?('tmux config')
install_files(Dir.glob('vimify/*')) if want_to_install?('vimification of command line tools')
if want_to_install?('vim configuration (highly recommended)')
file_operation(Dir.glob('{vim,vimrc,vimrc.before}'))
install_files(Dir.glob('{vim,vimrc,vimrc.before}'))
Rake::Task["install_vundle"].execute
end

Expand All @@ -42,6 +42,7 @@ task :install_prezto do
end
end

desc 'Updates the installation'
task :update do
Rake::Task["vundle_migration"].execute if needs_migration_to_vundle?
Rake::Task["install"].execute
Expand Down Expand Up @@ -94,7 +95,7 @@ desc "Runs Vundle installer in a clean vim environment"
task :install_vundle do
puts "======================================================"
puts "Installing and updating vundles."
puts "The installer will now proceed to run BundleInstall."
puts "The installer will now proceed to run PluginInstall to install vundles."
puts "======================================================"

puts ""
Expand Down Expand Up @@ -182,7 +183,7 @@ def install_fonts
puts "Installing patched fonts for Powerline/Lightline."
puts "======================================================"
run %{ cp -f $HOME/.yadr/fonts/* $HOME/Library/Fonts } if RUBY_PLATFORM.downcase.include?("darwin")
run %{ mkdir -p ~/.fonts && cp ~/.yadr/fonts/* "$_" && fc-cache -vf ~/.fonts } if RUBY_PLATFORM.downcase.include?("linux")
run %{ mkdir -p ~/.fonts && cp ~/.yadr/fonts/* ~/.fonts && fc-cache -vf ~/.fonts } if RUBY_PLATFORM.downcase.include?("linux")
puts
end

Expand Down Expand Up @@ -261,7 +262,7 @@ def install_prezto
run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" }

# The prezto runcoms are only going to be installed if zprezto has never been installed
file_operation(Dir.glob('zsh/prezto/runcoms/z*'), :copy)
install_files(Dir.glob('zsh/prezto/runcoms/z*'), :symlink)

puts
puts "Overriding prezto ~/.zpreztorc with YADR's zpreztorc to enable additional modules..."
Expand Down Expand Up @@ -298,7 +299,7 @@ def want_to_install? (section)
end
end

def file_operation(files, method = :symlink)
def install_files(files, method = :symlink)
files.each do |f|
file = f.split('/').last
source = "#{ENV["PWD"]}/#{f}"
Expand Down
2 changes: 1 addition & 1 deletion bin/yadr/vundle.rb
Expand Up @@ -26,7 +26,7 @@ def self.vundle_list
end

def self.update_vundle
system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" +BundleClean +BundleInstall +qall"
system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" +BundleClean +BundleInstall! +qall"
end


Expand Down
18 changes: 18 additions & 0 deletions ctags/ctags
@@ -1,3 +1,4 @@

--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
Expand Down Expand Up @@ -35,3 +36,20 @@
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=.*->.*$/\1/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/

--langdef=css
--langmap=css:.css
--langmap=css:+.scss
--langmap=css:+.sass
--langmap=css:+.styl
--langmap=css:+.less
--regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/

--langdef=less
--langmap=less:.less
--regex-less=/^[ t]*.([A-Za-z0-9_-]+)/1/c,class,classes/
--regex-less=/^[ t]*#([A-Za-z0-9_-]+)/1/i,id,ids/
--regex-less=/^[ t]*(([A-Za-z0-9_-]+[ tn,]+)+){/1/t,tag,tags/
--regex-less=/^[ t]*@medias+([A-Za-z0-9_-]+)/1/m,media,medias/
10 changes: 5 additions & 5 deletions doc/vim/navigation.md
@@ -1,9 +1,9 @@
* 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
* EasyMotion - hit ,<esc> (forward) or ,<Shift-Esc> (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 row mostly. Using @skwp modified EasyMotion which uses vimperator-style two character targets.
* TagBar - hit ,T to see a list of methods in a class (uses ctags)
* CtrlP - ,t to find a file
* Visual-star-search - make the * (star) search in visual mode behave like expected: searching for the whole selection instead of just the word under the cursor.
* Ag - super fast search by Silver Searcher. hit `K` to grep current word
* EasyMotion - hit <kbd>,</kbd> <kbd>esc</kbd> (forward) or <kbd>,</kbd> <kbd>Shift</kbd> <kbd>Esc</kbd> (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 row mostly. Using @skwp modified EasyMotion which uses vimperator-style two character targets.
* TagBar - hit <kbd>,</kbd> <kbd>T</kbd> to see a list of methods in a class (uses ctags)
* CtrlP - <kbd>,</kbd> <kbd>t</kbd> to find a file
* Visual-star-search - make the <kbd>*</kbd> (star) search in visual mode behave like expected: searching for the whole selection instead of just the word under the cursor.
* Ag - super fast search by Silver Searcher. hit <kbd>K</kbd> to grep current word
* vim-tmux-navigator - nagivate between vim and tmux splits in the same way you move between normal vim splits.
2 changes: 1 addition & 1 deletion install.sh
Expand Up @@ -2,7 +2,7 @@

if [ ! -d "$HOME/.yadr" ]; then
echo "Installing YADR for the first time"
git clone git@github.com:burnettk/dotfiles.git "$HOME/.yadr"
git clone --depth=1 git@github.com:burnettk/dotfiles.git "$HOME/.yadr"
cd "$HOME/.yadr"
[ "$1" = "ask" ] && export ASK="true"
rake install
Expand Down
4 changes: 2 additions & 2 deletions tmux/tmux.conf
Expand Up @@ -10,8 +10,8 @@ bind-key ^D detach-client
# Create splits and vertical splits
bind-key v split-window -h -p 50 -c "#{pane_current_path}"
bind-key ^V split-window -h -p 50 -c "#{pane_current_path}"
bind-key s split-window -c -p 50 "#{pane_current_path}"
bind-key ^S split-window -c -p 50 "#{pane_current_path}"
bind-key s split-window -p 50 -c "#{pane_current_path}"
bind-key ^S split-window -p 50 -c "#{pane_current_path}"

# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to shift-ctrl-<h,j,k,l> in iTerm.
Expand Down
5 changes: 1 addition & 4 deletions vim/after/plugin/vimrc_after.vim
@@ -1,7 +1,4 @@
" https://github.com/carlhuda/janus/blob/master/janus/vim/core/janus/after/plugin/vimrc_after.vim
" Customization
"
" This loads after the janus plugins so that janus-specific plugin mappings can
" This loads after the yadr plugins so that plugin mappings can
" be overwritten.

if filereadable(expand("~/.yadr/vim/after/.vimrc.after"))
Expand Down
1 change: 0 additions & 1 deletion vim/settings/gotofile.vim
Expand Up @@ -4,4 +4,3 @@

" use ,gf to go to file in a vertical split
nnoremap <silent> ,gf :vertical botright wincmd F<CR>
nnoremap <silent> <C-F> :vertical botright wincmd F<CR>
2 changes: 2 additions & 0 deletions vim/settings/iterm-rspec.vim
Expand Up @@ -2,3 +2,5 @@ nnoremap ,rs :RunItermSpec<cr>
nnoremap ,rl :RunItermSpecLine<cr>
nnoremap ,ss :RunItermSpringSpec<cr>
nnoremap ,sl :RunItermSpringSpecLine<cr>
nnoremap zl :RunItermZeusSpecLine<cr>
nnoremap zs :RunItermZeusSpec<cr>
1 change: 0 additions & 1 deletion vim/settings/jquery.vim

This file was deleted.

3 changes: 0 additions & 3 deletions vim/settings/lusty-juggler.vim

This file was deleted.

4 changes: 2 additions & 2 deletions vim/settings/neocomplete.vim
Expand Up @@ -12,8 +12,8 @@ let g:neocomplete#max_list = 5
" Set minimum syntax keyword length.
let g:neocomplete#auto_completion_start_length = 3

" Map standard Ctrl-N completion to Cmd-Space
inoremap <D-Space> <C-n>
" Map standard Ctrl-N completion to Ctrl-Space
inoremap <C-Space> <C-n>
" This makes sure we use neocomplete completefunc instead of
" the one in rails.vim, otherwise this plugin will crap out.
Expand Down
7 changes: 0 additions & 7 deletions vim/settings/persistent-undo.vim

This file was deleted.

4 changes: 2 additions & 2 deletions vim/settings/rails.vim
@@ -1,3 +1,3 @@
" Better key maps for switching between controller and view
nnoremap ,vv :Rview<cr>
nnoremap ,cc :Rcontroller<cr>
nnoremap ,vv :Eview<cr>
nnoremap ,cc :Econtroller<cr>
8 changes: 0 additions & 8 deletions vim/settings/stop-visual-paste-insanity.vim

This file was deleted.

15 changes: 15 additions & 0 deletions vim/settings/syntastic.vim
Expand Up @@ -6,3 +6,18 @@ let g:syntastic_auto_jump=0
let g:syntastic_auto_loc_list=1
"don't care about warnings
let g:syntastic_quiet_messages = {'level': 'warnings'}

" I have no idea why this is not working, as it used to
" be a part of syntastic code but was apparently removed
" This will make syntastic find the correct ruby specified by mri
function! s:FindRubyExec()
if executable("rvm")
return system("rvm tools identifier")
endif

return "ruby"
endfunction

if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = s:FindRubyExec()
endif
6 changes: 0 additions & 6 deletions vim/settings/yadr-keymap-linux.vim
Expand Up @@ -58,12 +58,6 @@ map <silent> <A-7> :tabn 7<cr>
map <silent> <A-8> :tabn 8<cr>
map <silent> <A-9> :tabn 9<cr>
" Create window splits easier. The default
" way is Ctrl-w,v and Ctrl-w,s. I remap
" this to vv and ss
nnoremap <silent> vv <C-w>v
nnoremap <silent> ss <C-w>s
" Resize windows with arrow keys
nnoremap <C-Up> <C-w>+
nnoremap <C-Down> <C-w>-
Expand Down
6 changes: 0 additions & 6 deletions vim/settings/yadr-keymap-mac.vim
Expand Up @@ -58,12 +58,6 @@ map <silent> <D-7> :tabn 7<cr>
map <silent> <D-8> :tabn 8<cr>
map <silent> <D-9> :tabn 9<cr>
" Create window splits easier. The default
" way is Ctrl-w,v and Ctrl-w,s. I remap
" this to vv and ss
nnoremap <silent> vv <C-w>v
nnoremap <silent> ss <C-w>s
" Resize windows with arrow keys
nnoremap <D-Up> <C-w>+
nnoremap <D-Down> <C-w>-
Expand Down
8 changes: 6 additions & 2 deletions vim/settings/yadr-keymap.vim
Expand Up @@ -75,7 +75,7 @@ imap <C-a> <esc>wa
" ==== NERD tree
" Open the project tree and expose current file in the nerdtree with Ctrl-\
nnoremap <silent> <C-\> :NERDTreeFind<CR>:vertical res 30<CR>
nnoremap <silent> <C-\> :NERDTreeFind<CR>:vertical<CR>
" ,q to toggle quickfix window (where you have stuff like Ag)
" ,oq to open it back up (rare)
Expand All @@ -98,7 +98,6 @@ nnoremap <silent> ,x :bn<CR>
" nnoremap <silent> <C-j> <C-w>j

" Make gf (go to file) create the file, if not existent
nnoremap gf :e<cfile><CR>
nnoremap <C-w>f :sp +e<cfile><CR>
nnoremap <C-w>gf :tabe<cfile><CR>
Expand Down Expand Up @@ -157,3 +156,8 @@ map ,hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
" ,hp = html preview
map <silent> ,hp :!open -a Safari %<CR><CR>
" Map Ctrl-x and Ctrl-z to navigate the quickfix error list (normally :cn and
" :cp)
nnoremap <silent> <C-x> :cn<CR>
nnoremap <silent> <C-z> :cp<CR>
8 changes: 0 additions & 8 deletions vim/settings/yadr-search.vim

This file was deleted.

0 comments on commit 715047a

Please sign in to comment.