add Tedit

This commit is contained in:
Josh Holtrop 2016-06-30 12:15:24 -04:00
parent 52e08bb0a6
commit 973f95bc07

11
vimrc
View File

@ -227,6 +227,16 @@ function! PtagSymbolBeforeParen()
endif endif
endfunction 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 " Commands
"============================================================================== "==============================================================================
@ -236,6 +246,7 @@ command! -nargs=? Tf call FindSymbolInSources(b:test_sources, <f-args>)
command! Cedit exec 'rightbelow vertical sfind ' . substitute(expand('%:t:r'), "test_", "", "") . '.c' 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! CCedit exec 'rightbelow vertical sfind ' . substitute(expand('%:t:r'), "test_", "", "") . '.cc'
command! Hedit exec 'rightbelow vertical sfind ' . expand('%:t:r') . '.h' command! Hedit exec 'rightbelow vertical sfind ' . expand('%:t:r') . '.h'
command! Tedit call Tedit()
"============================================================================== "==============================================================================
" Machine-local Settings " Machine-local Settings