Browse Source

Add c++ yasnippets

master
Riyyi 5 years ago
parent
commit
49864129bd
  1. 9
      .emacs.d/snippets/c++-mode/class
  2. 8
      .emacs.d/snippets/c++-mode/constructor
  3. 5
      .emacs.d/snippets/c++-mode/define
  4. 8
      .emacs.d/snippets/c++-mode/destructor
  5. 5
      .emacs.d/snippets/c++-mode/fun_declaration
  6. 8
      .emacs.d/snippets/c++-mode/fun_implementation
  7. 10
      .emacs.d/snippets/c++-mode/guard
  8. 5
      .emacs.d/snippets/c++-mode/include
  9. 9
      .emacs.d/snippets/c++-mode/namespace
  10. 5
      .emacs.d/snippets/c++-mode/separator

9
.emacs.d/snippets/c++-mode/class

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: class
# key: cls
# --
class ${1:Name} {
public:
${1:$(yas-c++-class-name yas-text)}();
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}$0
};

8
.emacs.d/snippets/c++-mode/constructor

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: constructor
# key: ct
# --
${1:Name}::$1(${2:args}) ${3: : ${4:init}}
{
$0
}

5
.emacs.d/snippets/c++-mode/define

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: define
# key: d
# --
#define $0

8
.emacs.d/snippets/c++-mode/destructor

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: destructor
# key: dt
# --
${1:Name}::~$1()
{
$0
}

5
.emacs.d/snippets/c++-mode/fun_declaration

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: fun_declaration
# key: f
# --
${1:type} ${2:name}(${3:args})${4: const};

8
.emacs.d/snippets/c++-mode/fun_implementation

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: fun_implementation
# key: fim
# --
${1:type} ${2:name}(${3:args})${4: const}
{
$0
}

10
.emacs.d/snippets/c++-mode/guard

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: guard
# key: grd
# --
#ifndef ${1:GUARD}_H
#define ${1:GUARD}_H
$0
#endif // ${1:GUARD}_H

5
.emacs.d/snippets/c++-mode/include

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: include
# key: i
# --
#include $0

9
.emacs.d/snippets/c++-mode/namespace

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: namespace
# key: ns
# --
namespace ${1:Namespace} {
$0
}

5
.emacs.d/snippets/c++-mode/separator

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: separator
# key: spr
# --
// -----------------------------------------$0
Loading…
Cancel
Save