text-editor

Set default syntax to different filetype in Sublime Text 2

吃可爱长大的小学妹 提交于 2019-11-26 04:56:45
问题 How do I set a default filetype for a certain file extension in Sublime Text 2? Specifically I want to have *.cfg files default to having Ini syntax highlighting but I cannot seem to figure out how I could create this custom setting. 回答1: In the current version of Sublime Text 2 (Build: 2139), you can set the syntax for all files of a certain file extension using an option in the menu bar. Open a file with the extension you want to set a default for and navigate through the following menus:

Elegant way to search for UTF-8 files with BOM?

ε祈祈猫儿з 提交于 2019-11-26 02:39:39
问题 For debugging purposes, I need to recursively search a directory for all files which start with a UTF-8 byte order mark (BOM). My current solution is a simple shell script: find -type f | while read file do if [ \"`head -c 3 -- \"$file\"`\" == $\'\\xef\\xbb\\xbf\' ] then echo \"found BOM in: $file\" fi done Or, if you prefer short, unreadable one-liners: find -type f|while read file;do [ \"`head -c3 -- \"$file\"`\" == $\'\\xef\\xbb\\xbf\' ] && echo \"found BOM in: $file\";done It doesn\'t

Text editor to open big (giant, huge, large) text files [closed]

老子叫甜甜 提交于 2019-11-25 23:45:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . This post is a Community Wiki . Edit existing answers to improve this post. It is not currently accepting new answers. I mean 100+ MB