I'm using the last version of PHPStorm, which is 7 I think and want to have file support for files using a pattern such as *.extension but those don't have an extension. I tried pattern *, which works, but puts all of my files in bash highlighting.
Does anyone have a solution for that without using the .sh extension?
Edit:
Bash file are recognize with extension .sh and .bash. It's working nicely, but what I want is to set default file type on files with no extension. If I add .* or * in the list of bash file, all my files are recognize like bash file.
Hope it's more clear, sorry for the probable mistake in my English.
It may seem weird - but you can try to actually list the files you're using explicitly reading their names.
Not sure of your use-case, but I needed it for git hooks, and there's not so much names for existing git hooks, so it's not that hard to list those :)
For the reference:
Preferences > Editor > File Types > Bourne Again Shell:
Related
I understand that Prettier uses https://github.com/mrmlnc/fast-glob#pattern-syntax for the file/dir/glob element of its CLI.
For my package.json I need a prettier 'one-liner' to examine files which are NOT in the top level apps or modules folders (these folders have other formatting mechanisms).
According to fast-glob I expected to be able to run a command like this to run prettier over files NOT in those folders.
npx prettier '!{apps,modules}/**'
However, this never matches any files. What do I need to change about my syntax?
I am interested in tracking a binary file with Hg. For visual diffing, it would be beneficial to use a specific custom tool. Is it possible to tell TortoiseHg to use a specific tool, based on file extension?
Just read <TortoiseHg>/hgrc.d/MergePatterns.rc file for common pattern and ideas, add own key(s) in [diff-patterns] inside global hg-config file.
Usual diff inside THG will call you tool for predefined extension
I'm facing a problem in training the Tesseract OCR for Kannada font (Lohit Kannada and Kedage), when it comes to numerals.
For example, 0 is getting recognized as 8 (and ನ as ವ).
I needed help in including the unicharambigs file (the documentation on Github describes the format solely).My output.txt file has not changed,despite including the unicharambigs file.
Suppose [lang] corresponds to kan, will the following command include the unicharambigs file in the kan.traineddata file?
combine_tessdata kan.
Incase it doesn't, I'd appreciate any help regarding how to proceed with the same.
Difficult to answer not knowing which version of tesseract and kan.traineddata you're using.
You can unpack the kan.traineddata to see the version of kan.unicharabigs included in it and then recombine it after editing the file.
see https://github.com/tesseract-ocr/tesseract/blob/master/doc/combine_tessdata.1.asc for command syntax
Use -u option to unpack:
-u .traineddata PATHPREFIX Unpacks the .traineddata using the provided prefix.
Use -o option to overwrite ucharambigs:
-o .traineddata FILE…: Overwrites the specified components of the .traineddata file with those provided on the command line.
Please note that https://github.com/tesseract-ocr/langdata/blob/master/kan/kan.unicharambigs seems to be a copy of eng.unicharambigs
I am creating a filter for files coming onto a Unix machine. I only want to allow plain text files that do not look like scripts to pass through.
For checking plain text I am checking the executable bit of the file and using the -T file test from perl. (I understand this is not 100%, but it will catch the binary files I most want to avoid). I think this will be sufficient, but any suggestions are welcome.
My main question is in recognizing when a plain text file is a script. Every script I've ever written has started out with a #! line, so my first thought is to read in the file's first line and block any containing that. Are there common non-script plain text files that start with the #! line that I will flag with a false-positive? Are there better/additional methods of identifying a script?
That's what the file command (see Wikipedia) is for. It recognizes much more than just the she-bang (#!), and can tell you what kind of script it is, if any.
I have an XSL that transforms an XML file into a HTML file. Works great. But I would like to apply to a directory of files. Ideally a new HTML file for each XML file would be plunked down in the same directory.
I'm using Windows XP. I've got Cygwin, and am good enough with shell scripting. I've now got Saxon, but haven't been able to accomplish much with it so far. Right now I'm doing something like
java -jar settings.saxon_path -t -s:sourceFilepathNormal -xsl:normalizePath(myXSLT) -o:newXMLFilepathNormal
in a for loop on each file in the directory, but this seems hella clunky to me. Actually, doesn't seem that way, I know its clunky. What is the most elegant way you would accomplish this task with the tools at hand?
You can do this using the collection() function as suggested; but there's also a facility on the Saxon command line to process a whole directory. Just give a directory name as the value of the -s argument and another directory as the value of the -o argument.
If you prefer a GUI approach, KernowForSaxon also has the capability to apply the same transformation to every file in a folder.
You can do this easily in XSLT 2.0 using the standard XPath 2.0 function collection() and the XSLT 2.0 instruction <xsl:result-document>.
As the collection() function is only superficially defined in the W3C Spec, read the more Saxon-specific bits here:
And see for example my answer to this question.
Try:
find . -name *.xml -exec java -jar settings.saxon_path -t -s:{} -xsl:normalizePath(myXSLT) -o:{}.html \;