honza/snipmate-snippets — Issue #68: c++ import guard / how to capitalize the file name
Author: sotte
Created: 2012-01-24 12:27:06+00:00
State: open

Hey,

This is not really an issue, but maybe you can help me anyway.

I want to write an import guard for C++. So far it looks something like this:

``` vim
snippet guard
#ifndef ${1:`substitute(expand('%:t'), '\.', '_', 'g')`}
#define $1

#endif /* $1 */
```

What I get:

``` cpp
#ifndef filename_h
#define filename_h

#endif /* filename_h */
```

But what I want:

``` cpp
#ifndef FILENAME_H
#define FILENAME_H

#endif /* FILENAME_H */
```

So how can I capitalize the filename?