Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use screen for test runs.

  • Loading branch information...
commit 24ec20da68a37088158e43fab5b557e788223205 1 parent cbc0916
@saulius authored
Showing with 15 additions and 47 deletions.
  1. +3 −0  .gitmodules
  2. +1 −0  bundle/screen
  3. +11 −47 vimrc
View
3  .gitmodules
@@ -52,3 +52,6 @@
[submodule "bundle/supertab"]
path = bundle/supertab
url = https://github.com/ervandew/supertab.git
+[submodule "bundle/screen"]
+ path = bundle/screen
+ url = https://github.com/ervandew/screen.git
1  bundle/screen
@@ -0,0 +1 @@
+Subproject commit 3120f09f62f8924d3ab8583f02061aad9edb6460
View
58 vimrc
@@ -18,7 +18,7 @@ set background=light
syntax on
set t_Co=256
colorscheme espresso_soda
-:set fillchars+=vert:\
+:set fillchars+=vert:\
" Numbers
set number
@@ -158,49 +158,13 @@ map <leader>v :view %%
set wildmenu
set wildmode=longest,full
-" rspec mappings
-map <Leader>st :call RunCurrentSpecFile()<CR>
-map <Leader>ss :call RunNearestSpec()<CR>
-map <Leader>sl :call RunLastSpec()<CR>
-
-function! RunCurrentSpecFile()
- if InSpecFile()
- let l:command = SpecRunner() . "rspec " . @% . " -f documentation"
- call SetLastSpecCommand(l:command)
- call RunSpecs(l:command)
- endif
-endfunction
-
-function! RunNearestSpec()
- if InSpecFile()
- let l:command = SpecRunner() . "rspec " . @% . " -l " . line(".") . " -f documentation"
- call SetLastSpecCommand(l:command)
- call RunSpecs(l:command)
- endif
-endfunction
-
-function! SpecRunner()
- if filereadable("zeus.json")
- return "zeus "
- else
- return "bundle exec "
- endif
-endfunction
-
-function! RunLastSpec()
- if exists("t:last_spec_command")
- call RunSpecs(t:last_spec_command)
- endif
-endfunction
-
-function! InSpecFile()
- return match(expand("%"), "_spec.rb$") != -1
-endfunction
-
-function! SetLastSpecCommand(command)
- let t:last_spec_command = a:command
-endfunction
-
-function! RunSpecs(command)
- execute ":w\|!clear && echo " . a:command . " && echo && " . a:command
-endfunction
+" Screen settings
+let g:ScreenImpl = 'Tmux'
+let g:ScreenShellTmuxInitArgs = '-2'
+let g:ScreenShellInitialFocus = 'shell'
+let g:ScreenShellQuitOnVimExit = 0
+map <F5> :ScreenShellVertical<CR>
+command -nargs=? -complete=shellcmd W :w | :call ScreenShellSend("load '".@%."';")
+map <Leader>rc :ScreenShellVertical bundle exec rails c<CR>
+map <Leader>sl :w<CR> :call ScreenShellSend("rspec ".@% . ':' . line('.'))<CR>
+map <Leader>sf :w<CR> :call ScreenShellSend("rspec ".@%)<CR>
Please sign in to comment.
Something went wrong with that request. Please try again.