(Emacs)+snippets from doom-snippet and removed default package
I've re-enabled yasnippet for ease of use, and added a ton of snippets directly into my Dotfiles so only I get to curate what snippets are removed. Screw downloading them off someone else's repository at their total mercy.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
cc-mode text-mode prog-mode
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: param
|
||||
# key: @param
|
||||
# uuid: @param
|
||||
# condition: (sp-point-in-comment)
|
||||
# --
|
||||
@param ${1:paramater} $0
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: return
|
||||
# key: @return
|
||||
# uuid: @return
|
||||
# condition: (sp-point-in-comment)
|
||||
# --
|
||||
@return ${1:description}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: apr_assert
|
||||
# key: apr_assert
|
||||
# uuid: apr_assert
|
||||
# --
|
||||
if (Globals.useAssertions) {
|
||||
${1:assert ..};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: class
|
||||
# key: class
|
||||
# uuid: class
|
||||
# --
|
||||
${1:public }class ${2:`(f-base buffer-file-name)`} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: constructor
|
||||
# key: __init__
|
||||
# uuid: __init__
|
||||
# --
|
||||
public ${1:`(f-base buffer-file-name)`}($2) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: doc
|
||||
# key: /*
|
||||
# uuid: /*
|
||||
# condition: (not (use-region-p))
|
||||
# --
|
||||
/**
|
||||
* $0
|
||||
*/
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: equals
|
||||
# key: eq
|
||||
# uuid: eq
|
||||
# --
|
||||
public boolean equals(${1:Class} other) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: file_class
|
||||
# key: file
|
||||
# uuid: file
|
||||
# --
|
||||
public class ${1:`(file-name-base
|
||||
(or (buffer-file-name)
|
||||
(buffer-name)))`} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for
|
||||
# key: for
|
||||
# uuid: for
|
||||
# --
|
||||
for (${1:int i = 0}; ${2:i < N}; ${3:i++}) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: foreach
|
||||
# key: fore
|
||||
# uuid: fore
|
||||
# --
|
||||
for (${1:Object} ${2:var} : ${3:iterator}) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if
|
||||
# key: if
|
||||
# uuid: if
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
if (${1:true}) {
|
||||
$0
|
||||
}
|
||||
10
Emacs/.config/emacs/.config/yasnippet/snippets/java-mode/ife
Normal file
10
Emacs/.config/emacs/.config/yasnippet/snippets/java-mode/ife
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ife
|
||||
# key: ife
|
||||
# uuid: ife
|
||||
# --
|
||||
if (${1:true}) {
|
||||
$2
|
||||
} else {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# --
|
||||
import ${1:System.};
|
||||
$0
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: interface
|
||||
# key: interface
|
||||
# uuid: interface
|
||||
# --
|
||||
interface ${1:`(f-base buffer-file-name)`} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: iterator
|
||||
# key: iterator
|
||||
# uuid: iterator
|
||||
# --
|
||||
public Iterator<${1:type}> iterator() {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: javadoc
|
||||
# key: doc
|
||||
# uuid: doc
|
||||
# --
|
||||
/**
|
||||
* $0
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: main
|
||||
# key: main
|
||||
# uuid: main
|
||||
# --
|
||||
public static void main(String[] args) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: method
|
||||
# key: method
|
||||
# uuid: method
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
${1:void} ${2:name}($3) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: @Override method
|
||||
# key: method@
|
||||
# uuid: method@
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
@Override ${1:public} ${2:void} ${3:methodName}($4) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: new
|
||||
# key: new
|
||||
# uuid: new
|
||||
# --
|
||||
${1:Type} ${2:obj} = new ${3:$1}($4);$0
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: paintComponent (Swing)
|
||||
# key: paintComponent
|
||||
# uuid: paintComponent
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
@Override public void paintComponent(Graphics g) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: printf
|
||||
# key: printf
|
||||
# uuid: printf
|
||||
# --
|
||||
System.out.printf("$0%n");
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: println
|
||||
# key: println
|
||||
# uuid: println
|
||||
# --
|
||||
System.out.println("$0");
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: private
|
||||
# key: pri
|
||||
# uuid: pri
|
||||
# --
|
||||
private $0
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: protected
|
||||
# key: pr
|
||||
# uuid: pr
|
||||
# --
|
||||
protected $0
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: public
|
||||
# key: p
|
||||
# uuid: p
|
||||
# --
|
||||
public $0
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: return
|
||||
# key: ret
|
||||
# uuid: ret
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
return $0;
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test
|
||||
# key: test
|
||||
# uuid: test
|
||||
# --
|
||||
@Test
|
||||
public void test_${1:Case}() {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: testClass
|
||||
# key: tc
|
||||
# uuid: tc
|
||||
# --
|
||||
import junit.framework.*;
|
||||
import junit.textui.*;
|
||||
|
||||
public class Test${1:Class} extends TestCase {
|
||||
protected void setUp() {
|
||||
$0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: this
|
||||
# key: .
|
||||
# uuid: .
|
||||
# --
|
||||
this.$0
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: toString
|
||||
# key: toStr
|
||||
# uuid: toStr
|
||||
# --
|
||||
public String toString() {
|
||||
$0
|
||||
}
|
||||
12
Emacs/.config/emacs/.config/yasnippet/snippets/java-mode/try
Normal file
12
Emacs/.config/emacs/.config/yasnippet/snippets/java-mode/try
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: try
|
||||
# key: try
|
||||
# uuid: try
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
try {
|
||||
$0
|
||||
} catch (${1:Throwable} e) {
|
||||
${2:System.out.println("Error " + e.getMessage());
|
||||
e.printStackTrace();}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: variable declaration
|
||||
# key: var
|
||||
# uuid: var
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
${1:int} ${2:variable}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: variable declaration & assignment
|
||||
# key: var=
|
||||
# uuid: var=
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
${1:int} ${2:variable} = $0;
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: void
|
||||
# key: v
|
||||
# uuid: v
|
||||
# --
|
||||
void $0
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: while loop
|
||||
# key: while
|
||||
# uuid: while
|
||||
# condition: (not (sp-point-in-string-or-comment))
|
||||
# --
|
||||
while (${1:true}) {
|
||||
$0
|
||||
}
|
||||
Reference in New Issue
Block a user