text-editor

Set default syntax to different filetype in Sublime Text 2

五迷三道 提交于 2019-11-26 16:46:55
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. 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: View -> Syntax -> Open all with current extension as... ->[your syntax choice] . Updated 2012-06-28: Recent

Does Notepad++ show all hidden characters?

荒凉一梦 提交于 2019-11-26 15:12:13
In Notepad++ I have set "replace tab with 2 spaces". When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors, which I solved in the end by removing all "visible" spaces at line beginnings and inserting the same amount of spaces again. Could it be possible that Scintilla based Notepad++ does not show all special characters, but displays them as spaces? Is there a setting to fix this? Steve Willcock Yes, it does. The way to enable this depends on your version of Notepad++. On newer versions you can use:

How do I enable the column selection mode in Eclipse?

喜夏-厌秋 提交于 2019-11-26 12:49:16
问题 News wrote that Eclipse 3.5 finally supports column selection. Unfortunately I don\'t know HOW to enable it. I tried pressing the ALT-key like I am used to in Visual Studio and all other Microsoft products but that had no effect. How can I mark a vertical block in Eclipse? 回答1: To activate the cursor and select the columns you want to select use: Windows: Alt + Shift + A Mac: command + option + A Linux-based OS: Alt + Shift + A To deactivate , press the keys again. This information was taken

Is there a valid reason for enforcing a maximum width of 80 characters in a code file, this day and age? [closed]

大兔子大兔子 提交于 2019-11-26 12:34:33
问题 Seriously. On a 22\" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule. I\'m not saying that there shouldn\'t be a limit; I\'m just saying, 80 characters is very small. 回答1: I think the practice of keeping code to 80 (or 79) columns was originally created to support people editing code on 80-column dumb terminals or on 80-column printouts. Those requirement have mostly gone away now, but there are still valid reasons to keep the 80 column rule: To

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

拜拜、爱过 提交于 2019-11-26 11:59:26
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 work with filenames that contain a line break, but such files are not to be expected anyway. Is there any shorter or more elegant

How to edit multi-gigabyte text files? Vim doesn't work =( [closed]

杀马特。学长 韩版系。学妹 提交于 2019-11-26 11:50:27
问题 Are there any editors that can edit multi-gigabyte text files, perhaps by only loading small portions into memory at once? It doesn\'t seem like Vim can handle it =( 回答1: If you are on *nix (and assuming you have to modify only parts of file (and rarely)), you may split the files (using the split command), edit them individually (using awk , sed , or something similar) and concatenate them after you are done. cat file2 file3 >> file1 回答2: Ctrl-C will stop file load. If the file is small

Visual Studio C# statement collapsing

那年仲夏 提交于 2019-11-26 11:47:20
问题 When editing really long code blocks (which should definitely be refactored anyway, but that\'s beyond the scope of this question), I often long for the ability to collapse statement blocks like one can collapse function blocks. That is to say, it would be great if the minus icon appeared on the code outline for everything enclosed in braces. It seems to appear for functions, classes, regions, namespaces, usings, but not for conditional or iterative blocks. It would be fantastic if I could

How to prevent vim from creating (and leaving) temporary files?

…衆ロ難τιáo~ 提交于 2019-11-26 08:40:37
问题 Why does vim create <filename>~ files? Is there a way to disable that? If it\'s for backup (or something), I use git for that. Also, these .<filename.with.path.hints>.swp files too. How do I tell vim not to create those, or at the least to cleanup after itself? EDIT whoops, duplicate: Why does Vim save files with a ~ extension? I adopted rogeriopvl\'s answer from there. verbatim copy: set nobackup \"no backup files set nowritebackup \"only in case you don\'t want a backup file while editing

What&#39;s in your .emacs?

落花浮王杯 提交于 2019-11-26 07:50:43
问题 I\'ve switched computers a few times recently, and somewhere along the way I lost my .emacs. I\'m trying to build it up again, but while I\'m at it, I thought I\'d pick up other good configurations that other people use. So, if you use Emacs, what\'s in your .emacs? Mine is pretty barren right now, containing only: Global font-lock-mode! (global-font-lock-mode 1) My personal preferences with respect to indentation, tabs, and spaces. Use cperl-mode instead of perl-mode. A shortcut for

Does Notepad++ show all hidden characters?

喜欢而已 提交于 2019-11-26 05:58:09
问题 In Notepad++ I have set \"replace tab with 2 spaces\". When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors, which I solved in the end by removing all \"visible\" spaces at line beginnings and inserting the same amount of spaces again. Could it be possible that Scintilla based Notepad++ does not show all special characters, but displays them as spaces? Is there a setting to fix this? 回答1: Yes, it