X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vim%2Fftplugin%2Fpython%2Ftestname.vim;fp=vim%2F.vim%2Fftplugin%2Fpython%2Ftestname.vim;h=7ec780230136d338038ab694825af2e0aa3bc9b6;hp=e388f1bbb36657425a991e6254aace7aa5ec3a0a;hb=1280549be01e3ce72d9e0aeef6254a1ff14a25a3;hpb=86cacc081de452eb66d50f13261310b07f8ca2d4 diff --git a/vim/.vim/ftplugin/python/testname.vim b/vim/.vim/ftplugin/python/testname.vim index e388f1b..7ec7802 100644 --- a/vim/.vim/ftplugin/python/testname.vim +++ b/vim/.vim/ftplugin/python/testname.vim @@ -1,24 +1,2 @@ -" Nose-compatible test name preparer -" Maintainer: Sergey Matveev -" License: GNU General Public License version 3 of the License or later -" -" When standing inside TestCase's test method, type t and full -" Python (your.project.tests:TestCaseName.test_method_name) path will be -" copied to clipboard ("*) register. - -function! TestName() - normal mm - normal ?.*\s*def .*[Tt]est - normal ^f(Byw - let postfix = @" - normal [[f(Byw - let postfix = @" . "." . postfix - normal `m - let base = join([""] + split(getcwd(), "/")[:-1], "/") - let prefix = substitute(expand("%:p:r")[len(base)+1:], "/", ".", "g") - let name = prefix . ":" . postfix - let @* = name - echomsg name -endfunction - -nmap t :call TestName() +if exists("*python#testname#get") | finish | endif +nmap t :call python#testname#get()