From f2a30f2752a9b5450182c6e26695f1378c8ce245 Mon Sep 17 00:00:00 2001 From: Paul Gross Date: Fri, 19 Jan 2018 21:58:02 +0000 Subject: [PATCH] Switch to vim-test from homegrown vimux test plugins 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. --- vim/ftplugin/elixir.vim | 6 +++--- vim/ftplugin/java.vim | 2 -- vim/python_mappings.vim | 4 ++-- vim/ruby_mappings.vim | 31 +++---------------------------- vimrc | 3 +++ vimrc.bundles | 6 +----- 6 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 vim/ftplugin/java.vim diff --git a/vim/ftplugin/elixir.vim b/vim/ftplugin/elixir.vim index 0f5fda9c..87d9bb30 100644 --- a/vim/ftplugin/elixir.vim +++ b/vim/ftplugin/elixir.vim @@ -1,3 +1,3 @@ -map ra :wa :RunAllElixirTests -map rb :wa :RunCurrentElixirTests -map rf :wa :RunFocusedElixirTests +map ra :wa :TestSuite +map rb :wa :TestFile +map rf :wa :TestNearest diff --git a/vim/ftplugin/java.vim b/vim/ftplugin/java.vim deleted file mode 100644 index 0b5ff908..00000000 --- a/vim/ftplugin/java.vim +++ /dev/null @@ -1,2 +0,0 @@ -map ra :wa :RunAllBazelTests -map rb :wa :RunTargetBazelTests diff --git a/vim/python_mappings.vim b/vim/python_mappings.vim index 0f88ed91..8107c5e5 100644 --- a/vim/python_mappings.vim +++ b/vim/python_mappings.vim @@ -1,2 +1,2 @@ -map rb :wa :RunNoseTestBuffer -map rf :wa :RunNoseTestFocused +map rb :wa :TestFile +map rf :wa :TestNearest diff --git a/vim/ruby_mappings.vim b/vim/ruby_mappings.vim index ea96ca67..59fc1306 100644 --- a/vim/ruby_mappings.vim +++ b/vim/ruby_mappings.vim @@ -1,7 +1,6 @@ -map rb :wa :call _RunAll() -map rc :wa :RunRubyFocusedContext -map rf :wa :call _RunLine() -map rl :wa :call _RunLast() +map rb :wa :TestFile +map rf :wa :TestNearest +map rl :wa :TestLast map rx :wa :VimuxCloseRunner map ri :wa :VimuxInspectRunner map rs :!ruby -c % @@ -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 diff --git a/vimrc b/vimrc index 61361122..a88f82e4 100644 --- a/vimrc +++ b/vimrc @@ -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 diff --git a/vimrc.bundles b/vimrc.bundles index 43ac1e07..5f114f44 100644 --- a/vimrc.bundles +++ b/vimrc.bundles @@ -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' @@ -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' @@ -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'