mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-16 02:14:17 +00:00
Last commit before tagging and releasing
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: beginend
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: $1.begin(), $1.end()
|
||||
# --
|
||||
${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), ${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
|
||||
10
extras/imported/c-mode/Idioms/010 main() (main).yasnippet
Normal file
10
extras/imported/c-mode/Idioms/010 main() (main).yasnippet
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: main
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: main()
|
||||
# --
|
||||
int main (int argc, char const${TM_C_POINTER: *}argv[])
|
||||
{
|
||||
${0:/* code */}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: once
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Header Include-Guard
|
||||
# --
|
||||
#ifndef ${1:`#!/usr/bin/env ruby -wKU -riconv
|
||||
name = ENV["TM_FILENAME"] || "untitled"
|
||||
name = Iconv.iconv("ASCII//TRANSLIT", "UTF-8", name).first
|
||||
name = name.gsub(/[^a-z0-9]+/i, "_")
|
||||
uuid = (rand * 2821109907455).round.to_s(36)
|
||||
print "#{name}_#{uuid}".tr("[a-z]", "[A-Z]")
|
||||
`}
|
||||
#define $1
|
||||
|
||||
${TM_SELECTED_TEXT/\Z\n//}${0:}
|
||||
|
||||
#endif /* end of include guard: $1 */
|
||||
13
extras/imported/c-mode/Idioms/read file (readF).yasnippet
Normal file
13
extras/imported/c-mode/Idioms/read file (readF).yasnippet
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: readfile
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Read File Into Vector
|
||||
# --
|
||||
std::vector<char> v;
|
||||
if(FILE${TM_C_POINTER: *}fp = fopen(${1:"filename"}, "r"))
|
||||
{
|
||||
char buf[1024];
|
||||
while(size_t len = fread(buf, 1, sizeof(buf), fp))
|
||||
v.insert(v.end(), buf, buf + len);
|
||||
fclose(fp);
|
||||
}
|
||||
Reference in New Issue
Block a user