Snippets and vim updates and such, oh my
git-svn-id: http://photonzero.com/dotfiles/trunk@33 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
a0995d6be5
commit
9d2548e8a9
56 changed files with 13433 additions and 129 deletions
30
.vim/snippets/cpp.snippets
Normal file
30
.vim/snippets/cpp.snippets
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Read File Into Vector
|
||||
snippet readfile
|
||||
std::vector<char> v;
|
||||
if (FILE *${2:fp} = fopen(${1:"filename"}, "r")) {
|
||||
char buf[1024];
|
||||
while (size_t len = fread(buf, 1, sizeof(buf), $2))
|
||||
v.insert(v.end(), buf, buf + len);
|
||||
fclose($2);
|
||||
}${3}
|
||||
# std::map
|
||||
snippet map
|
||||
std::map<${1:key}, ${2:value}> map${3};
|
||||
# std::vector
|
||||
snippet vector
|
||||
std::vector<${1:char}> v${2};
|
||||
# Namespace
|
||||
snippet ns
|
||||
namespace ${1:`Filename('', 'my')`} {
|
||||
${2}
|
||||
} /* $1 */
|
||||
# Class
|
||||
snippet cl
|
||||
class ${1:`Filename('$1_t', 'name')`} {
|
||||
public:
|
||||
$1 (${2:arguments});
|
||||
virtual ~$1 ();
|
||||
|
||||
private:
|
||||
${3:/* data */}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue