Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
duniul committed Jul 29, 2020
0 parents commit e36aaaa
Show file tree
Hide file tree
Showing 16 changed files with 947 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
*.vsix
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"proseWrap": "always"
}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
7 changes: 7 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/**
.vscode/**
.vscode-test/**
.gitignore
.prettierrc
.yarn.lock
*.vsix
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

## 1.0.0

- Initial release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Daniel Grefberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<p align="center">
<img width="500" src="images/dircolors-syntax-example.png">
</p>

# vscode-dircolors

📁🌈 VS Code syntax highlighting and snippets for `.dircolors` files.

## Syntax highlighting

- Highlights comments, keywords, file extensions and values.
- Enables auto-commenting.

## Snippets

This extension adds several nifty snippets that can help with remembering color/attribute codes and
keywords. As with any snippet, simply write the prefix and press tab to convert it to the value.

- Colors can be prefixed with `b` to make it a background color instead.
- `$1` indicates where the cursor ends up after pressing tab.

#### Prefix/result table

| Color | | Attribute | | Keyword | |
| -------- | ----- | ---------- | ----- | ------- | --------------- |
| black | `30;` | none | `00;` | T | `TERM $1\n` |
| bblack | `40;` | bold | `01;` | C | `COLOR $1\n` |
| red | `31;` | \_ | `04;` | E | `EIGHTBIT $1\n` |
| bred | `41;` | underscore | `04;` | O | `OPTION $1\n` |
| green | `32;` | blink | `05;` | N | `NORMAL 00\n` |
| bgreen | `42;` | reverse | `07;` | F | `FILE $1\n` |
| yellow | `33;` | concealed | `08;` | D | `DIR $1\n` |
| byellow | `43;` | | | L | `LINK $1\n` |
| blue | `34;` | | | M | `MISSING $1\n` |
| bblue | `44;` | | | S | `SOCK $1\n` |
| magenta | `35;` | | | B | `BLK $1\n` |
| bmagenta | `45;` | | | X | `EXEC $1\n` |
| cyan | `36;` | | | | |
| bcyan | `46;` | | | | |
| white | `37;` | | | | |
| bwhite | `47;` | | | | |

## Credits

Grammar files and snippets were adapted from
[language-dircolors](https://github.com/jolkdarr/language-dircolors) by
[jolkdarr](https://github.com/jolkdarr), a similar extension for Sublime Text.
Binary file added images/dircolors-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/dircolors-syntax-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"comments": {
"lineComment": "#"
}
}
72 changes: 72 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "dircolors",
"displayName": "dircolors",
"description": "Syntax highlighting and snippets for .dircolors files",
"version": "1.0.0",
"author": "Daniel Grefberg",
"publisher": "duniul",
"repository": {
"type": "git",
"url": "https://github.com/duniul/vscode-dircolors"
},
"bugs": {
"url": "https://github.com/duniul/vscode-dircolors/issues"
},
"homepage": "https://github.com/duniul/vscode-dircolors",
"icon": "images/dircolors-icon.png",
"engines": {
"vscode": "^1.47.0"
},
"categories": [
"Programming Languages",
"Snippets"
],
"keywords": [
"shell",
"bash",
"zsh",
"fish",
"dircolors",
"LS_COLORS"
],
"contributes": {
"languages": [
{
"id": "dircolors",
"aliases": [
"dircolors",
"LS_COLORS"
],
"extensions": [
".dircolors"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "dircolors",
"scopeName": "source.dircolors",
"path": "./syntaxes/dircolors.tmLanguage.json"
}
],
"snippets": [
{
"language": "dircolors",
"path": "./snippets/attributes.json"
},
{
"language": "dircolors",
"path": "./snippets/colors.json"
},
{
"language": "dircolors",
"path": "./snippets/keywords.json"
}
]
},
"devDependencies": {
"prettier": "^2.0.5",
"vsce": "^1.77.0"
}
}
26 changes: 26 additions & 0 deletions snippets/attributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"none": {
"prefix": "none",
"body": "00;"
},
"bold": {
"prefix": "bold",
"body": "01;"
},
"underscore": {
"prefix": ["_", "underscore"],
"body": "04;"
},
"blink": {
"prefix": "blink",
"body": "05;"
},
"reverse": {
"prefix": "reverse",
"body": "07;"
},
"concealed": {
"prefix": "concealed",
"body": "08;"
}
}
66 changes: 66 additions & 0 deletions snippets/colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"black": {
"prefix": "black",
"body": "30;"
},
"bblack": {
"prefix": "bblack",
"body": "40;"
},
"red": {
"prefix": "red",
"body": "31;"
},
"bred": {
"prefix": "bred",
"body": "41;"
},
"green": {
"prefix": "green",
"body": "32;"
},
"bgreen": {
"prefix": "bgreen",
"body": "42;"
},
"yellow": {
"prefix": "yellow",
"body": "33;"
},
"byellow": {
"prefix": "byellow",
"body": "43;"
},
"blue": {
"prefix": "blue",
"body": "34;"
},
"bblue": {
"prefix": "bblue",
"body": "44;"
},
"magenta": {
"prefix": "magenta",
"body": "35;"
},
"bmagenta": {
"prefix": "bmagenta",
"body": "45;"
},
"cyan": {
"prefix": "cyan",
"body": "36;"
},
"bcyan": {
"prefix": "bcyan",
"body": "46;"
},
"white": {
"prefix": "white",
"body": "37;"
},
"bwhite": {
"prefix": "bwhite",
"body": "47;"
}
}
50 changes: 50 additions & 0 deletions snippets/keywords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"term": {
"prefix": "T",
"body": "TERM $1\n"
},
"color": {
"prefix": "C",
"body": "COLOR $1\n"
},
"eightbit": {
"prefix": "E",
"body": "EIGHTBIT $1\n"
},
"option": {
"prefix": "O",
"body": "OPTION $1\n"
},
"normal": {
"prefix": "N",
"body": "NORMAL 00\n"
},
"file": {
"prefix": "F",
"body": "FILE $1\n"
},
"dir": {
"prefix": "D",
"body": "DIR $1\n"
},
"link": {
"prefix": "L",
"body": "LINK $1\n"
},
"missing": {
"prefix": "M",
"body": "MISSING $1\n"
},
"sock": {
"prefix": "S",
"body": "SOCK $1\n"
},
"blk": {
"prefix": "B",
"body": "BLK $1\n"
},
"exec": {
"prefix": "X",
"body": "EXEC $1\n"
}
}
Loading

0 comments on commit e36aaaa

Please sign in to comment.