atom-shell-commands
atom-shell-commands copied to clipboard
use unicode escapes in config.cson
Thanks a lot for this plug-in. It saves a lot work, avoiding the need of making new plug-ins for every external command integration.
I am trying to integrate the comand for this solution: http://stackoverflow.com/a/9395552/469294
More or less:
grep --color='auto' -P -n "[\x80-\xFF]" {FileName}
so I did try:
"atom-shell-commands":
commands: [
{
name: "grep_unicode"
command: "grep"
arguments: [
"--color='auto'"
"-P"
"-n"
"\"[\x80-\xFF]\""
"{FileName}"
]
options:
cwd: "{FileDir}"
keymap: "cmd-u"
}
]
but it doesn't work:
grep","--color='auto'","-P","-n","\"[-ÿ]\"","myFile.java"]
Usage: grep [OPTION]... PATTERN [FILE]...
Search for PATTERN in each FILE or standard input.
.....
How am I supposed to specify the escape sequence for those unicode characters ?
Did you try escaping the backslashes? It looks like the command did what it was supposed to. In CSON, \x80
is replaced with �
in the string content, so write \\x80
, and the string content will end up as \x80
.