|
|
@ -196,6 +196,8 @@ for prefix in ['i', 'n', 'v'] |
|
|
execute prefix . "noremap " . key . " <Nop>" |
|
|
execute prefix . "noremap " . key . " <Nop>" |
|
|
endfor |
|
|
endfor |
|
|
endfor |
|
|
endfor |
|
|
|
|
|
"[Switch quickly between source and header]" |
|
|
|
|
|
nnoremap <leader>f :e <C-r>=SwapExtension()<CR><CR> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -242,6 +244,22 @@ function! ChangeScriptMode() |
|
|
endif |
|
|
endif |
|
|
endif |
|
|
endif |
|
|
endfunction |
|
|
endfunction |
|
|
|
|
|
"[Swap file extensions, for example cpp/h]" |
|
|
|
|
|
"https://stackoverflow.com/a/22145246" |
|
|
|
|
|
function! SwapExtension() |
|
|
|
|
|
let [rest, ext] = [expand('%:r'), expand('%:e')] |
|
|
|
|
|
if ext ==? 'h' |
|
|
|
|
|
let ext = 'cpp' |
|
|
|
|
|
elseif ext ==? 'cpp' |
|
|
|
|
|
let ext = 'h' |
|
|
|
|
|
"swap between vertex and fragment shader" |
|
|
|
|
|
elseif ext ==? 'vsh' |
|
|
|
|
|
let ext = 'fsh' |
|
|
|
|
|
elseif ext ==? 'fsh' |
|
|
|
|
|
let ext = 'vsh' |
|
|
|
|
|
endif |
|
|
|
|
|
return rest . '.' . ext |
|
|
|
|
|
endfunction |
|
|
|
|
|
|
|
|
" Only do this part when compiled with support for autocommands. |
|
|
" Only do this part when compiled with support for autocommands. |
|
|
if has("autocmd") |
|
|
if has("autocmd") |
|
|
|