Skip to content

Commit

Permalink
more vscode improvements (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rdeisenroth authored Sep 9, 2024
1 parent 6d49fea commit 866c632
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 227 deletions.
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ghcr.io/tudalgo/algotex:latest

# install pre-commit
RUN apt-get update \
&& apt-get -y install pre-commit sudo

# setup non-root user
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# Add sudo support.
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
# set the default shell to bash rather than sh
&& chsh -s /bin/bash $USERNAME

# set the default user.
USER $USERNAME
21 changes: 9 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "latex",
"image": "ghcr.io/tudalgo/algotex:latest",
"build": {
"dockerfile": "Dockerfile"
},
"initializeCommand": "docker pull ghcr.io/tudalgo/algotex:latest",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -10,9 +13,11 @@
// Other helpers
"shardulm94.trailing-spaces",
"stkb.rewrap", // rewrap comments after n characters on one line
"dangmai.workspace-default-settings",
// Other
"vscode-icons-team.vscode-icons",
"draivin.hsnips"
"draivin.hsnips",
"valentjn.vscode-ltex"
],
"settings": {
// General settings
Expand All @@ -21,23 +26,15 @@
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.linting.chktex.exec.path": "chktex",
"latex-workshop.latex.clean.subfolder.enabled": true,
"files.insertFinalNewline": true,
"latex-workshop.latex.autoClean.run": "onBuilt",
"editor.formatOnSave": true,
"files.associations": {
"*.tex": "latex",
"*.sty": "latex-expl3",
"*.cls": "latex-expl3",
"*.def": "latex",
"*.aux": "latex",
"*.toc": "latex",
"*.pygstyle": "latex",
"*.pygtex": "latex"
},
"latex-workshop.latexindent.path": "latexindent",
"latex-workshop.latexindent.args": [
"-c",
"%DIR%/",
"%TMPFILE%",
"-l",
"-y=defaultIndent: '%INDENT%'"
],
"latex-workshop.latex.tools": [
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### VS-Code ###
/.vscode/
.vscode/*
!.vscode/extensions.json
!.vscode/settings.default.json
!.vscode/*.code-snippets
.VSCodeCounter/

### Intellij ###
Expand Down Expand Up @@ -106,6 +109,7 @@ comp/

## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bbl-SAVE-ERROR
*.bcf
*.blg
*-blx.aux
Expand Down Expand Up @@ -372,3 +376,6 @@ TSWLatexianTemp*
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib
.secrets
options.cfg
svg-inkscape/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
hooks:
- id: autopep8
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: '2.7.3' # pick a git hash / tag to point to
rev: '3.0.3' # pick a git hash / tag to point to
hooks:
- id: editorconfig-checker
exclude_types: [tex,python]
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"James-Yu.latex-workshop",
"dangmai.workspace-default-settings",
"valentjn.vscode-ltex"
]
}
60 changes: 60 additions & 0 deletions .vscode/latex.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"task": {
"prefix": "\\task",
"body": [
"\\begin{task}[points=${1:auto}]{${2:Aufgabentitel}}",
"\t$0",
"\\end{task}"
],
"description": "Create A Task Environment",
"scope": "latex"
},
"subtask": {
"prefix": "\\subtask",
"body": [
"\\begin{subtask*}[points=${1:1}]{${2:Aufgabentitel}}",
"\t$0",
"\\end{subtask*}"
],
"description": "Create A Subtask Environment",
"scope": "latex"
},
"inlinejava": {
"prefix": [
"\\inlinejava",
],
"body": "\\inlinejava{$0}",
"description": "Displays java code inline",
"scope": "latex"
},
"Def Box": {
"prefix": "\\defBox",
"body": [
"\\begin{defBox}",
"\t$0",
"\\end{defBox}"
],
"description": "Create An Definition Box (accentcolor Stripe, light accentcolor Background)",
"scope": "latex"
},
"Info Box": {
"prefix": "\\infoBox",
"body": [
"\\begin{infoBox}",
"\t$0",
"\\end{infoBox}"
],
"description": "Create An Info Box (accentcolor Stripe, no Background)",
"scope": "latex"
},
"Gray Info Box": {
"prefix": "\\grayInfoBox",
"body": [
"\\begin{grayInfoBox}",
"\t$0",
"\\end{grayInfoBox}"
],
"description": "Create A Gray Info Box (gray Stripe, gray Background)",
"scope": "latex"
},
}
33 changes: 33 additions & 0 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"latex-workshop.latexindent.args": [
"-c",
"%DIR%/",
"%TMPFILE%",
"-l=%WORKSPACE_FOLDER%/latexindent.yaml",
"-y=defaultIndent: '%INDENT%'"
],
"latex-workshop.latex.verbatimEnvs": [
"verbatim",
"lstlisting",
"minted",
"codeBlock"
],
"files.associations": {
"*.sty": "latex-expl3",
"*.cls": "latex-expl3",
"*.def": "latex",
"*.aux": "latex",
"*.toc": "latex",
"*.pygstyle": "latex",
"*.pygtex": "latex"
},
"grammarly.selectors": [
{
"language": "latex",
"scheme": "file"
}
],
"latex-workshop.bibtex-format.tab": "4 spaces",
"ltex.language": "de-DE",
"files.insertFinalNewline": true
}
5 changes: 0 additions & 5 deletions contrib/.vscode/extensions.json

This file was deleted.

Loading

0 comments on commit 866c632

Please sign in to comment.