Add snippets for Dockerfile, Fish shell, JavaScript, Perl, and Org

This commit is contained in:
Seong Yong-ju 2019-11-27 00:28:10 +09:00
parent 2cc5f35cd4
commit 5880275481
15 changed files with 105 additions and 3 deletions

View File

@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# name: dockerize for Alpine Images
# key: alpine-dockerize
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil))
# --
ENV DOCKERIZE_VERSION ${1:v0.6.1}
RUN apk update && \
apk --no-cache add openssl && \
wget https://github.com/jwilder/dockerize/releases/download/\${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz && \
tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz && \
rm dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz

6
snippets/fish-mode/bang Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: bang
# key: !
# --
#!/usr/bin/env fish
$0

7
snippets/fish-mode/block Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: begin ... end
# key: block
# --
begin
$0
end

6
snippets/fish-mode/bp Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: breakpoint
# key: bp
# --
breakpoint
$0

7
snippets/fish-mode/for Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for loop
# key: for
# --
for ${1:var} in ${2:stuff}
$0
end

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: function
# key: function
# --
function ${1:name}
$0
end

8
snippets/fish-mode/if Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: if ... end
# key: if
# --
if ${1:[ -f file ]}
${2:do}
end
$0

10
snippets/fish-mode/ife Normal file
View File

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: if ... ... else ... end
# key: ife
# --
if ${1:cond}
${2:stuff}
else
${3:other}
end
$0

8
snippets/fish-mode/sw Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: switch
# key: sw
# --
switch ${1:condition}
case ${2:*}
${0}
end

7
snippets/fish-mode/while Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: while loop
# key: while
# --
while ${1:cond}
$0
end

5
snippets/js-mode/flow Normal file
View File

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: /* @flow */
# key: flow
# --
/* @flow */

7
snippets/org-mode/src Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: src
# key: <src
# --
#+BEGIN_SRC $1
$0
#+END_SRC

6
snippets/perl-mode/bang Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: bang
# key: !
# --
#!/usr/bin/env perl
$0

7
snippets/perl-mode/enc Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: encoding
# key: enc
# --
binmode STDOUT, ':encoding(UTF-8)';
binmode STDERR, ':encoding(UTF-8)';
$0

View File

@ -1,9 +1,8 @@
# -*- mode: snippet -*-
# name: use
# key: use_
# name: strict
# key: strict
# contributor: Spenser Truex
# --
#!/usr/bin/perl
use warnings;
use strict;
$0