You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the cheat files can not have extension, this caused 2 problems:
although optional, I need to specify special headers in file, e.g.:
---
syntax: javascript
tags: [ array, map ]
---
This is a bit memory burden, and make cheat files not generic.
without extension, syntax highlight won't work directly in editors.
I like to use markdown format in vscode.
However, when I open a cheat file such as mysql with vscode, It can not detect the correct type.
This also applies to bash, javascript syntax types.
Suggestion
I would like this tool can support file extensions.
For example, if I want to create a cheat file with markdown syntax, I just save it as tcpdump.md.
This is a valid/generic markdown file, which means users can write a cheat file without learning anything.
In file top, I don't need to begin with the special header.
And, when I edit in editor, I get correct syntax highlighting.
What's more interesting, I can also create cheat files for other syntax, such as requests.py, awk.sh, jquery.js.
I can even run it to verify it's working, although that may lead to some problems, such as you have sudo rm / in your script.
But there are many ways to avoid such things, and it's not mandatory to make it really valid.
From the cheat code, that means, cheat mysql will not only search for a file with exact name mysql, it will try to match any files with basename mysql, such as mysql.txt, mysql.sh, mysql.md, and mysql.
That change won't break current function.
And when there are multiple ones, we can ask user to choose which version, or show all.
The text was updated successfully, but these errors were encountered:
Problem
Currently the cheat files can not have extension, this caused 2 problems:
This is a bit memory burden, and make cheat files not generic.
I like to use markdown format in vscode.
However, when I open a cheat file such as
mysql
with vscode, It can not detect the correct type.This also applies to bash, javascript syntax types.
Suggestion
I would like this tool can support file extensions.
For example, if I want to create a cheat file with markdown syntax, I just save it as
tcpdump.md
.This is a valid/generic markdown file, which means users can write a cheat file without learning anything.
In file top, I don't need to begin with the special header.
And, when I edit in editor, I get correct syntax highlighting.
What's more interesting, I can also create cheat files for other syntax, such as
requests.py
,awk.sh
,jquery.js
.I can even run it to verify it's working, although that may lead to some problems, such as you have
sudo rm /
in your script.But there are many ways to avoid such things, and it's not mandatory to make it really valid.
From the cheat code, that means,
cheat mysql
will not only search for a file with exact namemysql
, it will try to match any files with basenamemysql
, such asmysql.txt
,mysql.sh
,mysql.md
, andmysql
.That change won't break current function.
And when there are multiple ones, we can ask user to choose which version, or show all.
The text was updated successfully, but these errors were encountered: