View difference between Paste ID: Fx2xJ8Pg and 181FAuKV
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-
     if l:Extension == "hpp"
4+
     let l:Alternate = l:Extension == '.hpp' ? l:Filename.".cpp" : l:Filename.".hpp"
5-
         let l:Alternate = l:Filename.".cpp"
5+
6-
     elseif l:Extension == "cpp"
6+
7-
         let l:Alternate = l:Filename.".hpp"
7+
8
endfunction
9
10
nnoremap <localleader>a :call SwitchToAlternate()<cr>