How to avoid namespace content indentation in vim?

Not sure when it was introduced but my installed version of vim, v7.3.353 has a cino option that handles cpp namespace explicitly. I am currently using the example value: cino=N-s and as per :help cinoptions-values NN Indent inside C++ namespace N characters extra compared to a normal block. (default 0). cino= cino=N-s namespace { namespace … Read more

How to auto indent a C++ class with 4 spaces using clang-format?

As near as I can tell, clang-format offers no option for indenting function contents differently from non-access-modifier class contents. That is, consider the following code: class A { public: void foo() {} } void bar() { int a; } In this code, the line “void foo() {}” will always be indented the same amount as … Read more

How do I change the autoindent to 2 space in IPython notebook

The official documentation has an example answering this specific question. This worked for me with IPython 4. Summary: Paste the following into your browser’s javascript console var cell = Jupyter.notebook.get_selected_cell(); var config = cell.config; var patch = { CodeCell:{ cm_config:{indentUnit:2} } } config.update(patch) The setting is persisted. You can roll back by exchanging : 2 … Read more

How do I Change VSCode To Indent 4 Spaces Instead Of Default 2?

[*] Bit of an late answer. But just got the same issue solved… Multiple things are able to control this. It also has taken me quite a bit of experimentation to get it corrected. For me point 3 below was the final trick to make it work. Before that, I noticed the editor loading with … Read more