Skip to content

Commit

Permalink
C++ snippet for namespace and type aliases and for using directives a…
Browse files Browse the repository at this point in the history
…nd declarations
  • Loading branch information
Aster89 authored and lpil committed Sep 12, 2022
1 parent cc77a81 commit faaa499
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UltiSnips/cpp.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
endsnippet

snippet nsa "namespace alias"
namespace ${1:alias} = ${2:namespace};
endsnippet

snippet using "using directive/using declaration/type alias"
using ${1:namespace}`!p snip.rv = ' ' if t[1] == 'namespace' else ' = ' if t[1] != '' else ''`${2:name};
endsnippet

snippet readfile "read file (readF)"
std::vector<char> v;
if (FILE *fp = fopen(${1:"filename"}, "r"))
Expand Down

0 comments on commit faaa499

Please sign in to comment.