Skip to content

Instantly share code, notes, and snippets.

View awidegreen's full-sized avatar

Armin Widegreen awidegreen

View GitHub Profile
@awidegreen
awidegreen / vimrc
Created February 24, 2013 22:47
vim header file hook to include template
fun! CppHeaderFileHook()
let l:filename = tolower(expand("%"))
let l:filename = substitute(l:filename, ".hh$","_HH_", "")
let l:filename = toupper(l:filename)
source ~/templates/cpp_header.template
execute "silent %s/FILENAME_HH_/".l:filename."/g"
endfun
autocmd BufNewFile *.hh call CppHeaderFileHook()
@awidegreen
awidegreen / bash_template.sh
Created April 22, 2012 13:41
bash template
#!/bin/bash
scriptname="script_template"
### functions
function usage
{
echo -e "usage: $scriptname MANDATORY [OPTION]\n"
echo -e "MANDATORY mandatory parameter:"
echo -e " -m, --mandatory VAL The desc of the mandatory parameter\n"