View difference between Paste ID: PQ0qujxS and YFR9eVYU
SHOW: | | - or go back to the newest paste.
1
function! SwitchToAlternate()
2
     let l:Filename = expand('%:t:r')
3
     let l:Extension = expand('%:t:e')
4-
     let l:Alternate = l:Extension == '.hpp' ? l:Filename.".cpp" : l:Filename.".hpp"
4+
     let l:Alternate = l:Extension == "hpp" ? l:Filename.".cpp" : l:Filename.".hpp"
5
     echom "switching to ".l:Alternate
6
     exec "e ".l:Alternate
7
endfunction
8
9
nnoremap <localleader>a :call SwitchToAlternate()<cr>