Language code meta generator
type Cat {
const string name;
u32 age;
# This a comment
func meow(string sound, u32 volume) string;
}
tg test/cat.tg go --jsonpackage main
type Cat struct {
Name string `json:"name"`
Age uint32 `json:"age"`
}
func (cat *Cat) meow(sound string, volume uint32) string {
panic("TODO: Unimplemented method")
}- Go
- Java
- JavaScript
- Kotlin
- Rust
type
const
func
enum
u8
u16
u32
u64
i8
i16
i32
i64
f64
string
bool
char
- In settings navigate Editor | File Types | Recognized file types | Add
- Write a name, description (shown as label)
- Put
#in Line comment - Mark selected:
- support paired parens
- support paired brackets
- In Keywords section:
- at number 1 copy-paste keywords
- at number 4 copy-paste primitive types
- In File name patterns associate it with
*.tg
Source the syntax file with the editor command:
:so res/pocketgen.vim
You can also source it automatically by adding it to your vim.rc/init.lua.