Skip to content

Commit

Permalink
added snippets to vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoval committed Oct 18, 2024
1 parent 1df4e7f commit 023097f
Show file tree
Hide file tree
Showing 121 changed files with 2,135 additions and 185 deletions.
7 changes: 5 additions & 2 deletions link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ ln -sFv "$SCRIPT_DIR/link/.config/direnv" ~/.config
ln -sFv "$SCRIPT_DIR/nvim" ~/.config
ln -sFv "$SCRIPT_DIR/submodules/packer.nvim" "$NVIM_PLUGINS_DIRECTORY"
ln -sFv "$SCRIPT_DIR/prompt_rkoval_setup" ~/.zgen/sorin-ionescu/prezto-master/modules/prompt/functions
ln -sFv "$SCRIPT_DIR/vscode/extension/rkoval" ~/.cursor/extensions/rkoval
ln -sFv "$SCRIPT_DIR/vscode/extension/rkoval" ~/.vscode/extensions/rkoval

mkdir -p ~/.cursor/extensions
mkdir -p ~/.vscode/extensions
ln -sFv "$SCRIPT_DIR/vscode/extension/rkoval.rkoval-0.0.1" ~/.cursor/extensions
ln -sFv "$SCRIPT_DIR/vscode/extension/rkoval.rkoval-0.0.1" ~/.vscode/extensions
1 change: 1 addition & 0 deletions sublime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
15 changes: 15 additions & 0 deletions sublime/convert-snippets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
npm install

for dir in ./snippets/*/; do
if [ -d "$dir" ]; then
dirname=$(basename "$dir")
echo "Processing directory: $dirname"
./node_modules/.bin/snippetToVsCode -s "$dir" -o "../vscode/extension/rkoval/snippets/$dirname.code-snippets"
# Remove leading and trailing newline characters from the 'body' key using jq
jq 'map_values(.body |= if type == "array" then map(sub("^\n"; "") | sub("\n$"; "")) else sub("^\n"; "") | sub("\n$"; "") end)' "../vscode/extension/rkoval/snippets/$dirname.code-snippets" > temp.json && mv temp.json "../vscode/extension/rkoval/snippets/$dirname.code-snippets"

prettier --write "../vscode/extension/rkoval/snippets/$dirname.code-snippets"
fi
done
Loading

0 comments on commit 023097f

Please sign in to comment.