Created
May 15, 2012 09:04
-
-
Save dahu/2700225 to your computer and use it in GitHub Desktop.
generate header-file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Creates a header file from the function declarations within the current C | |
" file. | |
" Barry Arthur, 2012 05 15 | |
let header = expand('%:r') . '.h' | |
if filereadable(header) | |
echo "Header file " . header . " exists!" | |
finish | |
endif | |
silent exe "!touch " . header | |
g/^\w\+.\{-}(.\{-}).*{\s*$/ silent exe "silent . write >> " . header | |
exe "e " . header | |
%s/\s*{\s*$/;/ | |
%s/\s*\w\+)/)/ | |
%s/\s*\w\+,/,/g | |
%s/()/(void)/ | |
redraw! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment