diff --git a/.aliases.zsh b/.aliases.zsh index 4770a2e..33d15e4 100644 --- a/.aliases.zsh +++ b/.aliases.zsh @@ -5,7 +5,7 @@ alias ll='ls -GFhl' # alias ls='ls -GFhl' # BUNDLER -alias bi='bundle install' +alias bi='bundle install && spring stop' # RAILS alias restart='mkdir -p tmp && touch tmp/restart.txt' @@ -16,6 +16,7 @@ alias gs='git status -s' alias ga='git add' alias gbr='git branch' +alias gbf='git branch | cut -c3- | fzf | xargs git checkout' alias gcl='git clone' alias gco='git checkout' @@ -41,5 +42,6 @@ alias vim="mvim -v" # NOCORRECT +alias rspec='bin/rspec --format VimFormatter --out quickfix.out --format progress' alias mvim='nocorrect mvim' alias spring='nocorrect spring' diff --git a/.gitconfig b/.gitconfig index abb1fc3..2f11163 100644 --- a/.gitconfig +++ b/.gitconfig @@ -54,7 +54,7 @@ aliases = config --get-regexp '(alias.*)' [core] - excludesfile = /Users/mikekreeki/.gitignore + excludesfile = /Users/mikekreeki/.dotfiles/git/.gitignore editor = "mvim -f" ; [merge] diff --git a/.vimrc b/.vimrc index e912aaf..0bff6f4 100644 --- a/.vimrc +++ b/.vimrc @@ -17,6 +17,7 @@ Plugin 'scrooloose/syntastic' Plugin 'Shougo/neocomplete.vim' Plugin 'Shougo/neosnippet.vim' + Bundle 'Shougo/neosnippet-snippets' Plugin 'Yggdroot/indentLine' Plugin 'kien/rainbow_parentheses.vim' Plugin 'Lokaltog/vim-powerline' @@ -38,14 +39,13 @@ Plugin 'ntpeters/vim-better-whitespace' Plugin 'AndrewRadev/multichange.vim' Plugin 'rhysd/conflict-marker.vim' - " Plugin 'rhysd/clever-f.vim' Plugin 'idanarye/vim-merginal' Plugin 'rking/ag.vim' Plugin 'tpope/vim-fugitive' Plugin 'int3/vim-extradite' Plugin 'tpope/vim-rvm' - " Plugin 'tpope/vim-bundler' + Plugin 'tpope/vim-bundler' Plugin 'tpope/vim-rails' Plugin 'vim-ruby/vim-ruby' @@ -63,6 +63,7 @@ Plugin 'groenewege/vim-less' Plugin 'justinj/vim-react-snippets' Plugin 'depuracao/vim-rdoc' + Plugin 'mtscout6/vim-cjsx' Plugin 'airblade/vim-gitgutter' Plugin 'janko-m/vim-test' @@ -91,6 +92,8 @@ Plugin 'kmnk/vim-unite-giti' Plugin 'Shougo/neomru.vim' Plugin 'mattn/ctrlp-launcher' + Plugin 'tpope/vim-rsi' + Plugin 'skwp/greplace.vim' call vundle#end() @@ -133,10 +136,28 @@ set scrolloff=1 + " Syntax coloring lines that are too long just slows down the world + set synmaxcol=300 + + " Use only 1 space after "." when joining lines instead of 2 + set nojoinspaces + + " Don't reset cursor to start of line when moving around + set nostartofline + + " show completion on the mode-line + set wildmenu + + " Auto-reload buffers when files are changed on disk + set autoread + if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal" set t_Co=256 endif + au BufWritePost .vimrc so $MYVIMRC + nnoremap V :e $MYVIMRC + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " INDENTATION @@ -293,6 +314,10 @@ set history=250 set updatetime=750 + set undofile " Save undo's after file closes + set undodir=~/.vim/undo " where to save undo histories + set undolevels=1000 " How many undos + set undoreload=10000 " number of lines to save for undo """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " MOVING BETWEEN FILES @@ -305,6 +330,8 @@ nmap s :only:AV + let g:netrw_liststyle = 0 + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " MODES @@ -383,8 +410,8 @@ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ALIASES - :command! W w - :command! Q q + cnoreabbrev W w + cnoreabbrev Q q :command! Stop !spring stop @@ -469,6 +496,10 @@ highlight! link DiffDelete GitGutterDelete highlight! link DiffChange GitGutterChange + " Make those debugger statements painfully obvious + au BufEnter *.rb syn match error contained "\" + au BufEnter *.rb syn match error contained "\" + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " CONCEAL @@ -577,10 +608,7 @@ nmap R :TestNearest nmap r :TestFile - " nmap a :TestSuite - " nmap l :TestLast - let g:test#ruby#rspec#executable = 'bundle exec rspec' let g:test#ruby#rspec#options = '--no-color' " Not vim-test related @@ -615,7 +643,7 @@ let g:neocomplete#sources#tags#cache_limit_size = 5000000 let g:neosnippet#enable_snipmate_compatibility = 1 - let g:neosnippet#snippets_directory='~/.vim/snippets' + let g:neosnippet#snippets_directory='~/.vim/bundle/vim-react-snippets/snippets' imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) @@ -735,6 +763,13 @@ nmap :ZoomWin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" greplace.vim + + set grepprg=ag + + let g:grep_cmd_opts = '--line-numbers --noheading' + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Unite @@ -763,6 +798,11 @@ " Convert hashes to 1.9 syntax nmap h :%s/:\([^=,'"]*\) =>/\1:/gc + " Treat JSON files like JavaScript + au BufNewFile,BufRead *.json setf javascript + + " Make sure all markdown files have the correct filetype + au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} setf markdown " vim-github-dashboard let g:github_dashboard = { 'username': 'mikekreeki', 'password': $GITHUB_TOKEN } diff --git a/git/.gitignore b/git/.gitignore index a219873..771b549 100644 --- a/git/.gitignore +++ b/git/.gitignore @@ -10,6 +10,7 @@ Thumbs.db # RVM .rvmrc +.ruby-gemset # POW .powrc @@ -22,8 +23,12 @@ Thumbs.db .swp *.swp tags +.smartgf_tags +.smartgf_tags_date # RAILS .env config/mongoid.yml config/database.yml +quickfix.out +spec/vim_formatter.rb diff --git a/rspec/vim_formatter.rb b/rspec/vim_formatter.rb new file mode 100644 index 0000000..a339582 --- /dev/null +++ b/rspec/vim_formatter.rb @@ -0,0 +1,18 @@ +class VimFormatter + RSpec::Core::Formatters.register self, :example_failed + + def initialize(output) + @output = output + end + + def example_failed(notification) + @output << format(notification) + "\n" + end + + private + + def format(notification) + rtn = "%s: %s" % [notification.example.location, notification.exception.message] + rtn.gsub("\n", ' ')[0,160] + end +end