How can I install clang-format in Ubuntu?
With Ubuntu 16.04, simply do: sudo apt install clang-format
With Ubuntu 16.04, simply do: sudo apt install clang-format
go to Window –> preferences –> Web –> HTML files –> Editor. In the Inline Elements section, select all the elements that you don’t want eclipse to inline(continue with same line). Click Apply and then Ok. Now re format using ctrl + shift + f.
For chart.js 2.0+, this has changed (no more tooltipTemplate/multiTooltipTemplate). For those that just want to access the current, unformatted value and start tweaking it, the default tooltip is the same as: options: { tooltips: { callbacks: { label: function(tooltipItem, data) { return tooltipItem.yLabel; } } } } I.e., you can return modifications to tooltipItem.yLabel, which … Read more
<code> represents only a “fragment of computer code”. It was originally thought for simple code snippets like i++ or <code>. <pre> “represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements”. It’s original purpose was nothing more than exactly this: provide a text in the same way … Read more
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 language codes: actionscript3 bash clojure coldfusion cpp csharp css delphi erlang fsharp diff groovy html javascript … Read more
Follow the steps below to make Visual Studio Code format opening curly braces on a new line for Java Script and Type Script. In Visual Studio Code (v1.20.0) Go to File\Preferences\Settings Add the following lines in ‘User Settings‘ (in the right side pane) “javascript.format.placeOpenBraceOnNewLineForControlBlocks”: true, “javascript.format.placeOpenBraceOnNewLineForFunctions”: true, “typescript.format.placeOpenBraceOnNewLineForControlBlocks”: true, “typescript.format.placeOpenBraceOnNewLineForFunctions”: true, Save ‘User Settings‘ and … Read more
So, having messed around in the clang format code and made some patches, here’s my two cents: Clang format is based on, parsing the AST using libclang, which basically eliminates all whitespace breaking up the token sequence into “unwrapped lines” which are like “logical” code lines Applying rules / configuration info to sometimes split up … Read more
Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It’s in the documentation: Changing identation
I highlight the code and run Command Option L (a short-cut for the Code->Reformat Code menu). On Windows use Ctrl Alt L. Note that this only works if the code is well-formed JSON (clear any red squiggles).
The reformat code command in xcode is Ctrl-I, not Cmd-I and it appears to work just fine.