reformat

Remove trailing whitespace on save in IntelliJ IDEA 12

北慕城南 提交于 2019-12-03 10:22:20
问题 Is it possible to remove trailing whitespace automatically on save in IntelliJ IDEA? I know there are some workarounds, for example, using git to trim the whitespace on commit. Maybe this question is a duplicate of this one, but i hope this can be done without setting up keyboard shortcuts and macros. 回答1: Don't know about 12, but there's the following setting in 13: Settings → Editor → Strip trailing spaces on Save As of IntelliJ 2017.2 it's under Settings → Editor → General → Strip trailing

Remove trailing whitespace on save in IntelliJ IDEA 12

孤者浪人 提交于 2019-12-03 01:58:13
Is it possible to remove trailing whitespace automatically on save in IntelliJ IDEA? I know there are some workarounds, for example, using git to trim the whitespace on commit. Maybe this question is a duplicate of this one , but i hope this can be done without setting up keyboard shortcuts and macros. Vic Don't know about 12, but there's the following setting in 13: Settings → Editor → Strip trailing spaces on Save As of IntelliJ 2017.2 it's under Settings → Editor → General → Strip trailing spaces on Save Add an external tool. As the Program pass /usr/bin/sed (may be different on your box,

How enable auto-format code for Intellij IDEA?

断了今生、忘了曾经 提交于 2019-12-02 15:45:19
Is it possible in Intellij IDEA after typing ';' or press 'Enter' happened formatting of this string? For instance, to: a+b=10; after: a + b = 10; Or only possible option: Code > Reformat Code... ? Thank you! axelrod The auto-formatting shortcut in IntelliJ For windows Ctrl + Alt + L . For ubuntu Ctrl + Alt + windows + L . For Mac Command + Option + L . I have found two ways to do this: Go to Settings> Keymap. In the right portion go to Editor Actions> complete current statement. Click on it and select add keyboard shortcut. Press ; and select ok. Use macro. Go to Edit> Macros> Start Macro

How can you intercept pasting into a NSTextView to remove unsupported formatting?

拜拜、爱过 提交于 2019-12-01 04:03:29
I'm trying to create a simple NSTextView-based window for simple WYSIWYG editing. However, I only want to allow certain types of formatting (e.g. Bold, Italic, Underline and a single heading type but no colors or different fonts.) The issue is if I simply use NSTextView, someone can create or copy formatted text in another program, then simply paste it into that view and all that formatting goes with it, allowing things I'm not allowing, such as different fonts, colors, etc. At best, I want to automatically strip out any formatting that my application doesn't support. At worst, I want to

reformat in vim for a nice column layout

微笑、不失礼 提交于 2019-11-27 19:41:37
问题 I have this dataset in a csv file 1.33570301776, 3.61194e-06, 7.24503e-06, -9.91572e-06, 1.25098e-05, 0.0102828, 0.010352, 0.0102677, 0.0103789, 0.00161604, 0.00167978, 0.00159998, 0.00182596, 0.0019804, 0.0133687, 0.010329, 0.00163437, 0.00191202, 0.0134425 1.34538754675, 3.3689e-06, 9.86066e-06, -9.12075e-06, 1.18058e-05, 0.00334344, 0.00342207, 0.00332897, 0.00345504, 0.00165532, 0.00170412, 0.00164234, 0.00441903, 0.00459294, 0.00449357, 0.00339737, 0.00166596, 0.00451926, 0.00455153 1

Fast algorithm for polar -> cartesian conversion

三世轮回 提交于 2019-11-27 02:55:22
问题 I have an image on a polar grid. This image should be transformed into a cartesian grid, but the only algorithm I know of is really slow for this. Now I use the cartesian grid, for each point I find the r and theta values, and then I look in two vectors to find the smallest error defined by: min{(th_vec - theta)^2 + (range - r)^2} This gives a nested for-loop inside of the outer nested for-loop, so I have a complexity of O(N^4). A 512x512 image uses a whole minute to complete. Of course, a

How do I reformat HTML code using Sublime Text 2?

心已入冬 提交于 2019-11-26 11:27:10
I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read? peter You don't need any plugins to do this. Just select all lines ( Ctrl A ) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains HTML like .html or .php . If you do this often, you may find this key mapping useful: { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } } If your file is not saved (e.g. you

How do I reformat HTML code using Sublime Text 2?

大兔子大兔子 提交于 2019-11-26 02:26:00
问题 I\'ve got some poorly-formatted HTML code that I\'d like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read? 回答1: You don't need any plugins to do this. Just select all lines ( Ctrl A ) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains HTML like .html or .php . If you do this often, you may find this key mapping useful: { "keys": ["ctrl