Skip to content

Commit

Permalink
Switch to vim-test from homegrown vimux test plugins
Browse files Browse the repository at this point in the history
vim-test is a more full featured test runner than our current hodgepodge
of plugins. It also supports many different strategies, although this
commit configures it to use vimux for backwards compatibility.

The only loss in functionality seems to be :RunRubyFocusedContext which
would run the surrounding context. This still works with :TestNearest if
the cursor is on the context line.

This commit also deletes vimux-maven-test and vimux-bazel-test since
they seem unused.
  • Loading branch information
Paul Gross committed Jan 19, 2018
1 parent 5a6e15a commit f2a30f2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 40 deletions.
6 changes: 3 additions & 3 deletions vim/ftplugin/elixir.vim
@@ -1,3 +1,3 @@
map <silent> <LocalLeader>ra :wa<CR> :RunAllElixirTests<CR>
map <silent> <LocalLeader>rb :wa<CR> :RunCurrentElixirTests<CR>
map <silent> <LocalLeader>rf :wa<CR> :RunFocusedElixirTests<CR>
map <silent> <LocalLeader>ra :wa<CR> :TestSuite<CR>
map <silent> <LocalLeader>rb :wa<CR> :TestFile<CR>
map <silent> <LocalLeader>rf :wa<CR> :TestNearest<CR>
2 changes: 0 additions & 2 deletions vim/ftplugin/java.vim

This file was deleted.

4 changes: 2 additions & 2 deletions vim/python_mappings.vim
@@ -1,2 +1,2 @@
map <silent> <LocalLeader>rb :wa<CR> :RunNoseTestBuffer<CR>
map <silent> <LocalLeader>rf :wa<CR> :RunNoseTestFocused<CR>
map <silent> <LocalLeader>rb :wa<CR> :TestFile<CR>
map <silent> <LocalLeader>rf :wa<CR> :TestNearest<CR>
31 changes: 3 additions & 28 deletions vim/ruby_mappings.vim
@@ -1,7 +1,6 @@
map <silent> <LocalLeader>rb :wa<CR> :call _RunAll()<CR>
map <silent> <LocalLeader>rc :wa<CR> :RunRubyFocusedContext<CR>
map <silent> <LocalLeader>rf :wa<CR> :call _RunLine()<CR>
map <silent> <LocalLeader>rl :wa<CR> :call _RunLast()<CR>
map <silent> <LocalLeader>rb :wa<CR> :TestFile<CR>
map <silent> <LocalLeader>rf :wa<CR> :TestNearest<CR>
map <silent> <LocalLeader>rl :wa<CR> :TestLast<CR>
map <silent> <LocalLeader>rx :wa<CR> :VimuxCloseRunner<CR>
map <silent> <LocalLeader>ri :wa<CR> :VimuxInspectRunner<CR>
map <silent> <LocalLeader>rs :!ruby -c %<CR>
Expand All @@ -21,30 +20,6 @@ function! _BounceInferiorSlime()
endif
endfunction

function! _RunLast()
if _IsInferiorSlimeRunning()
execute "InferiorSlimeSpecLast"
else
execute "VimuxRunLastCommand"
endif
endfunction

function! _RunAll()
if _IsInferiorSlimeRunning()
execute "InferiorSlimeSpecFile"
else
execute "RunAllRubyTests"
endif
endfunction

function! _RunLine()
if _IsInferiorSlimeRunning()
execute "InferiorSlimeSpecLine"
else
execute "RunRubyFocusedTest"
endif
endfunction

function! _IsInferiorSlimeRunning()
if system("ps axo command | grep inferior-slime | grep -v grep") == ""
return 0
Expand Down
3 changes: 3 additions & 0 deletions vimrc
Expand Up @@ -188,6 +188,9 @@ let g:vim_markdown_folding_disabled = 1
let g:go_fmt_command = "goimports"
let g:go_highlight_trailing_whitespace_error = 0

let test#strategy = "vimux"
let test#python#runner = 'nose'

" ========= Shortcuts ========

" NERDTree
Expand Down
6 changes: 1 addition & 5 deletions vimrc.bundles
Expand Up @@ -15,8 +15,6 @@ Plug 'chase/vim-ansible-yaml'
Plug 'davidzchen/vim-bazel'
Plug 'ddrscott/vim-side-search'
Plug 'derekwyatt/vim-scala'
Plug 'drewolson/vimux-elixir-test'
Plug 'drewolson/vimux-maven-test'
Plug 'ekalinin/Dockerfile.vim'
Plug 'elixir-lang/vim-elixir'
Plug 'elubow/cql-vim'
Expand All @@ -27,6 +25,7 @@ Plug 'google/vim-jsonnet'
Plug 'guns/vim-clojure-highlight'
Plug 'guns/vim-clojure-static'
Plug 'henrik/vim-indexed-search'
Plug 'janko-m/vim-test'
Plug 'jergason/scala.vim'
Plug 'jgdavey/vim-turbux'
Plug 'hashivim/vim-terraform'
Expand All @@ -46,9 +45,6 @@ Plug 'mattn/emmet-vim'
Plug 'mileszs/ack.vim'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'pangloss/vim-javascript', { 'commit': 'ce0f529bbb938b42f757aeedbe8f5d95f095b51d' }
Plug 'pgr0ss/vimux-bazel-test'
Plug 'pgr0ss/vimux-ruby-test'
Plug 'pitluga/vimux-nose-test'
Plug 'rust-lang/rust.vim'
Plug 'scrooloose/nerdtree'
Plug 'tfnico/vim-gradle'
Expand Down

0 comments on commit f2a30f2

Please sign in to comment.