code-formatting

Is it possible to auto-format your code in Dreamweaver?

浪尽此生 提交于 2019-11-28 16:36:31
Is it possible to auto-format your code in Dreamweaver like in Visual Studio (ctrl+k+d) A quick Google search turns up these two possibilities: Commands > Apply Formatting Commands > Clean up HTML Commands > Apply Source Formatting. Works a treat. For the 2017 CC release this has been moved (after many years of habit development). Find it now at: Edit > Code > Apply Source Formatting. It may be prudent to set up a keyboard shortcut if this is something you'll need regularly. Edit > Keyboard Shortcuts Following works perfectly for me: -*click on COMMAND and click on APPLY SOURCE FORMATTING -

Code Wrap IntelliJ?

佐手、 提交于 2019-11-28 16:34:05
问题 How would be possible to assign a shortcut for word wrap like as sublime text do? i.e. if the code line is too long it should be automatically break to the next line. wikipedia.org.org/Word_wrap 回答1: I think "soft wrap" might be what you're after. It's read-only, i.e. does not change the characters in the file, it only wraps what you see on screen. Intellij >= 14.1.4 : As pointed out by looper in the comments, the options are under File > Settings > Editor > General - under the Virtual Space

Why does HTML5 recommend putting the code element inside pre?

此生再无相见时 提交于 2019-11-28 16:18:18
The HTML5 documentation recommends putting the code element inside the pre element, but I don't understand how this is better or more semantic than just using the code element and CSS. In their own example: <pre><code class="language-pascal">var i: Integer; begin i := 1; end.</code></pre> Could also be written (Making some assumptions about the browser's defaults for pre ): <style> code { display: block; white-space: pre; } </style> … <code class="language-pascal">var i: Integer; begin i := 1; end.</code> Even if the pre is there to distinguish a code block from an inline string of code, I don

Is it possible to format C++ code with VIM?

社会主义新天地 提交于 2019-11-28 16:13:18
I am rather new to VIM. I got some source code and this is a mess. At a first sight I would like at least to get a clear and organised view of the code, so I like to get it rightly formatted, I mean indented depending on the depth of the functions and so. I wonder if it can be done with VIM, and otherwise which other commandline tools for that can you recommend. Thanks While vim is a true Swiss-knife I still prefer external tools for some jobs. This approach is some times much more intuitive and easy to remember than using the built-in equivalent. In the case of indenting, I filter the whole

How do you format code on save in VS Code

二次信任 提交于 2019-11-28 15:45:31
I would like to automatically format TypeScript code using the build-in formatter when I save a file in Visual Studio Code. I'm aware of the following options, but none of them is good enough: Format manually Shift + Alt + F Format on type "editor.formatOnType": true It formats the line when you press enter. Unfortunatelly, it leaves it unformatted when you mouse-click another line or press up/down arrow. Use existing extension I tried this one , but it does not seem to work too well. Use beautify "beautify.onSave": true It does not work with TypeScript Write custom extension It's tricky if

How to format all Java files in an Eclipse project at one time?

房东的猫 提交于 2019-11-28 15:26:39
问题 I have an old Eclipse project and the code is not well formatted. I'd like to format all the .java files according to the settings in Eclipse. I don't want to edit every individual file with Ctrl + Shift + F . Is there a way to format all my files? Perhaps an Eclipse plugin? 回答1: Right click on the project root and select Source -> Format. This should work for at least version 3.8.1. and above. If the above does not work, you're probably using an older Eclipse-version. In such case you can

How to format code in Xcode? [duplicate]

北城余情 提交于 2019-11-28 15:06:12
This question already has an answer here: Code Formatting In Xcode 10 answers I wonder how can I format my code to align it neatly? Does it have a feature similar to Eclipse's ctrl shift f ? Piotr Kochański Select first the text you want to format and then press Ctrl + I . Use Cmd + A first if you wish to format all text in the selected file. Note : this procedure only re-indents the lines, it does not do any advanced formatting. Key combination to format all text on open file: Cmd ⌘ A + Ctrl I Right click (Ctrl + Click) -> Structure -> Re-indent Haven't used eclipse for a while, but, I think

How to auto-indent code in the Atom editor?

本小妞迷上赌 提交于 2019-11-28 14:57:33
How do you auto-indent your code in the Atom editor? In other editors you can usually select some code and auto-indent it. Is there a keyboard shortcut as well? Nacho L. I found the option in the menu, under Edit > Lines > Auto Indent. It doesn't seem to have a default keymap bound. You could try to add a key mapping (Atom > Open Your Keymap [on Windows: File > Settings > Keybindings > "your keymap file"]) like this one: 'atom-text-editor': 'cmd-alt-l': 'editor:auto-indent' It worked for me :) For Windows: 'atom-text-editor': 'ctrl-alt-l': 'editor:auto-indent' The accepted answer works, but

How to have the formatter wrap code with IntelliJ?

为君一笑 提交于 2019-11-28 14:20:56
问题 I'm not able to format my code in IntelliJ. I can see the margin line (by default at 120 columns) but it seems that the activation from the menu: Code -> Reformat Code is just ignoring this margin. 回答1: Do you mean that the formatter does not break long lines? Check Settings / Project Settings / Code Style / Wrapping. Update: in later versions of IntelliJ, the option is under Settings / Editor / Code Style. And select Wrap when typing reaches right margin . 回答2: IntelliJ IDEA 14, 15, 2016 &

How to blog code at wordpress.com [closed]

99封情书 提交于 2019-11-28 13:54:40
问题 got a new blog at wordpress few days ago (http://ghads.wordpress.com) and I want to post some code snippets now or then. Is there anyway to make it look like code without paying for extra plugins? 回答1: See here: http://en.support.wordpress.com/code/posting-source-code/ Wrap your code in these tags: [sourcecode language='css'] .. [/sourcecode] (or shorter [code lang='css'] .. [/code] ) Note that Visual Editor doesn't interpret the tags, you need to click Preview to see how it works. Available