Skip to content

Commit

Permalink
Added header snippets for shellscript and python
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Delafontaine committed Jul 19, 2022
1 parent 9a3a9d6 commit ee2c0ba
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ All notable changes to the "zhaw-snippets" extension will be documented in this

### 1.0.3

- Added header snippet for python
- Added header snippet for shell
- Added at least one empty line after the header insertion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,9 @@ Users appreciate release notes as you update your extension.
### 1.0.2

- Fixed latex header snippet

### 1.0.3

- Added header snippet for python
- Added header snippet for shell
- Added at least one empty line after the header insertion.
22 changes: 21 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "ZHAW Snippets",
"description": "A collection of ZHAW related snippets",
"icon": "imgs/zhaw.png",
"version": "1.0.2",
"version": "1.0.3",
"publisher": "InES-HPMM",
"engines": {
"vscode": "^1.64.0"
Expand Down Expand Up @@ -38,13 +38,33 @@
"language": "latex",
"path": "./snippets/latex.json"
},
{
"language": "python",
"path": "./snippets/python.json"
},
{
"language": "sh",
"path": "./snippets/shell.json"
},
{
"language": "shell",
"path": "./snippets/shell.json"
},
{
"language": "shellscript",
"path": "./snippets/shell.json"
},
{
"language": "tex",
"path": "./snippets/latex.json"
},
{
"language": "vhdl",
"path": "./snippets/vhdl.json"
},
{
"language":"zsh",
"path": "./snippets/shell.json"
}
]
},
Expand Down
31 changes: 31 additions & 0 deletions snippets/python.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"InES Header": {
"prefix": "inesh",
"body": [
"${1:#!/usr/bin/env python}",
"\"\"\"",
"${2:<brief description>}",
"",
"------------------------------------------------------------------",
"-- _____ ______ _____ --",
"-- |_ _| | ____|/ ____| --",
"-- | | _ __ | |__ | (___ Institute of Embedded Systems --",
"-- | | | '_ \\\\| __| \\___ \\ Zurich University of --",
"-- _| |_| | | | |____ ____) | Applied Sciences --",
"-- |_____|_| |_|______|_____/ 8401 Winterthur, Switzerland --",
"------------------------------------------------------------------",
"@author: ${3:<author>}",
"@contact: <${4:<email>}@zhaw.ch>",
"@copyright: ${CURRENT_YEAR} ZHAW Institute of Embedded Systems",
"@date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}",
"",
"${5}",
"------------------------------------------------------------------",
"\"\"\"",
"",
"",
"$0"
],
"description": "The InES file header"
}
}
27 changes: 27 additions & 0 deletions snippets/shell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"InES Header": {
"prefix": "inesh",
"body": [
"${1|#!/bin/sh,#!/bin/bash,#!/bin/fish,#!/bin/zsh|}",
"${LINE_COMMENT}#################################################################",
"${LINE_COMMENT}# _____ ______ _____ ##",
"${LINE_COMMENT}# |_ _| | ____|/ ____| ##",
"${LINE_COMMENT}# | | _ __ | |__ | (___ Institute of Embedded Systems ##",
"${LINE_COMMENT}# | | | '_ \\\\| __| \\___ \\ Zurich University of ##",
"${LINE_COMMENT}# _| |_| | | | |____ ____) | Applied Sciences ##",
"${LINE_COMMENT}# |_____|_| |_|______|_____/ 8401 Winterthur, Switzerland ##",
"${LINE_COMMENT}#################################################################",
"${LINE_COMMENT} File: ${TM_FILENAME}",
"${LINE_COMMENT} Author: ${2:<author>} <${3:<email>}@zhaw.ch>",
"${LINE_COMMENT} Copyright: ${CURRENT_YEAR} ZHAW Institute of Embedded Systems",
"${LINE_COMMENT} Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}",
"${LINE_COMMENT} Brief: ${4:<brief description>}",
"${LINE_COMMENT} ",
"${LINE_COMMENT} ${5}",
"${LINE_COMMENT}#################################################################",
"",
"$0"
],
"description": "The InES file header"
}
}

0 comments on commit ee2c0ba

Please sign in to comment.