yasnippet-snippets
yasnippet-snippets copied to clipboard
improve conversion from header file name to macro
trafficstars
Suppose we are in the file my-header.hpp. This snippet would expand the once macro to #define MY-HEADER_H which is not an ideal expansion because the MY-HEADER_H is not a valid macro definition and my file should be _HPP (for c++) and not _H. With this modification, this snippet will expand:
- my-header.hpp -> MY_HEADER_HPP
- my_header.h -> MY_HEADER_H
- my.header.hxx -> MY_HEADER_HXX