From 973f95bc070a2d6db919d68c9e293116756a6bde Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 30 Jun 2016 12:15:24 -0400 Subject: [PATCH] add Tedit --- vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vimrc b/vimrc index 413f350..4d93c36 100644 --- a/vimrc +++ b/vimrc @@ -227,6 +227,16 @@ function! PtagSymbolBeforeParen() endif endfunction +function! Tedit() + if &filetype == 'ruby' + exec 'leftabove vertical sfind ' . expand('%:t:r') . '_spec.rb' + elseif &filetype == 'cpp' + exec 'leftabove vertical sfind test_' . expand('%:t:r') . '.cc' + else + exec 'leftabove vertical sfind test_' . expand('%:t:r') . '.c' + endif +endfunction + "============================================================================== " Commands "============================================================================== @@ -236,6 +246,7 @@ command! -nargs=? Tf call FindSymbolInSources(b:test_sources, ) command! Cedit exec 'rightbelow vertical sfind ' . substitute(expand('%:t:r'), "test_", "", "") . '.c' command! CCedit exec 'rightbelow vertical sfind ' . substitute(expand('%:t:r'), "test_", "", "") . '.cc' command! Hedit exec 'rightbelow vertical sfind ' . expand('%:t:r') . '.h' +command! Tedit call Tedit() "============================================================================== " Machine-local Settings