16e895088b88

vim: kill makegreen
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 16 Nov 2010 17:03:00 -0500
parents d06b84e6f55f
children b33a75b39fde
branches/tags (none)
files vim/.vimrc vim/bundle/makegreen/README.md vim/bundle/makegreen/plugin/makegreen.vim

Changes

--- a/vim/.vimrc	Tue Nov 16 17:02:06 2010 -0500
+++ b/vim/.vimrc	Tue Nov 16 17:03:00 2010 -0500
@@ -167,7 +167,6 @@
 au BufNewFile,BufRead test_*.py set makeprg=nosetests\ --machine-out\ --nocapture
 au BufNewFile,BufRead test_*.py set shellpipe=2>&1\ >/dev/null\ \|\ tee
 au BufNewFile,BufRead test_*.py set errorformat=%f:%l:\ %m
-au BufNewFile,BufRead test_*.py nmap <silent> <Leader>n <Plug>MakeGreen
 au BufNewFile,BufRead test_*.py nmap <Leader>N :make<cr>
 nmap <silent> <leader>ff :QFix<cr>
 nmap <leader>fn :cn<cr>
--- a/vim/bundle/makegreen/README.md	Tue Nov 16 17:02:06 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-vim-MakeGreen
-=============
-
-makegreen.vim is a vim (http://www.vim.org) plugin that runs make and shows the
-test run status with a red or green bar.
-
-Installation
-------------
-
-Copy all files to your ~/.vim directory or use Tim Pope's excellent pathogen plugin (http://github.com/tpope/vim-pathogen).
-
-Usage
------
-
-&lt;Leader&gt;t will run make for the current file and show its status with a red or green message bar.
-
-example:
-
-    $ cd <your rails/merb root>
-    $ vim test/unit/user_test.rb
-
-    :compiler rubyunit
-    press <Leader>t
-
-(&lt;Leader&gt; is mapped to '\' by default)
-
-
-Default Key Bindings
---------------------
-
-&lt;Leader&gt;t: run make and show red/green bar
-
-You can change default key bindings:
-
-    map <Leader>] <Plug>MakeGreen " change from <Leader>t to <Leader>]
-
-Configuring Vim's Makeprg
--------------------------
-
-MakeGreen expects your make program to accept the current file name as its
-argument. Specifically, if `:make %` works, MakeGreen will work.
-
-Using Compilers
----------------
-
-The easiest way to use MakeGreen is with compilers. For instance, vim's ruby
-configuration files provide an rspec compiler that sets makeprg and errorformat
-appropriately for running specs and parsing their output.
-
-You can tell vim to use the rspec compiler for all *_spec.rb files by adding
-this line to your vimrc:
-
-      autocmd BufNewFile,BufRead *_spec.rb compiler rspec
-
-Then `:make %` (make current file) and MakeGreen will work automatically when
-you are in a spec.
-
-Credits
--------
-
-- Based on code from the rubytest.vim plugin
-  (http://github.com/reinh/vim-rubytest) but considerably refactored and
-  modified for this more specific purpose.
-
-- Red/Green bar code borrowed from Gary Bernhardt
-  (http://bitbucket.org/garybernhardt/dotfiles/src/tip/.vimrc) and slightly
-  modified for my use. Please do check out Gary's coding videos on his blog
-  for more awesome vim usage (http://blog.extracheese.org/).
-
-- elik and godlygeek in #vim on irc.freenode.net for vim help
-
-- Jim Remsik (@jremsikjr on twitter) for debugging and typo fixing.
--- a/vim/bundle/makegreen/plugin/makegreen.vim	Tue Nov 16 17:02:06 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-" plugin/makegreen.vim
-" Author:   Rein Henrichs <reinh@reinh.com>
-" License:  MIT License
-
-" Install this file as plugin/makegreen.vim.
-
-" ============================================================================
-
-" Exit quickly when:
-" - this plugin was already loaded (or disabled)
-" - when 'compatible' is set
-if &cp || exists("g:makegreen_loaded") && g:makegreen_loaded
-  finish
-endif
-let g:makegreen_loaded = 1
-
-let s:save_cpo = &cpo
-set cpo&vim
-
-function s:RunMake() "{{{1
-  silent! w
-  let s:old_sp = &shellpipe
-  "set shellpipe=> "quieter make output
-  silent! make %
-  let &shellpipe = s:old_sp
-
-  redraw!
-
-  let error = s:GetFirstError()
-  if error != ''
-    call s:Bar("red", error)
-  else
-    call s:Bar("green","All tests passed")
-  endif
-endfunction
-"}}}1
-" Utility Functions" {{{1
-function s:GetFirstError()
-  if getqflist() == []
-    return ''
-  endif
-
-  for error in getqflist()
-    if error['valid']
-      break
-    endif
-  endfor
-  let error_message = substitute(error['text'], '^ *', '', 'g')
-  let error_message = substitute(error_message, "\n", ' ', 'g')
-  let error_message = substitute(error_message, "  *", ' ', 'g')
-  return error_message
-endfunction
-
-function s:Bar(type, msg)
-  hi GreenBar term=reverse ctermfg=black ctermbg=green guifg=white guibg=green
-  hi RedBar   term=reverse ctermfg=white ctermbg=red guifg=white guibg=red
-  if a:type == "red"
-    echohl RedBar
-  else
-    echohl GreenBar
-  endif
-  echon a:msg repeat(" ", &columns - strlen(a:msg))
-  echohl None
-endfunction
-
-" }}}1
-" Mappings" {{{1
-
-noremap <unique> <script> <Plug>MakeGreen <SID>Make
-noremap <SID>Make :call <SID>RunMake()<CR>
-
-"if !hasmapto('<Plug>MakeGreen')
-  "map <unique> <silent> <Leader>test <Plug>MakeGreen
-"endif
-" }}}1
-
-let &cpo = s:save_cpo
-unlet s:save_cpo
-
-" vim:set sw=2 sts=2: