angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot change tabulation size

Open albanx opened this issue 10 years ago • 49 comments

Hi There Is there a way to set the tab size to 4 spaces instead of 2 of the new generated files?

Cheers Alban

albanx avatar Jun 30 '16 08:06 albanx

In the .editorconfig set indent_size = 4

Gelio avatar Jul 01 '16 15:07 Gelio

Already done, but this does not affect the Angular CLI

albanx avatar Jul 01 '16 21:07 albanx

The CLI doesn't provide this kind of functionality for scaffolded code, but you're more than welcome to format your code however you please.

filipesilva avatar Jul 03 '16 22:07 filipesilva

But this way one has to format the code every time he generates a new file. I will contribute and add this function.

albanx avatar Jul 04 '16 09:07 albanx

I agree that it is frustrating to have to reformat every file the cli spits out just so you can have the tab spacing you are chasing. Could the cli not reference .editorconfig when creating new files @filipesilva?

For Sublime users this setting in your Syntax Specific settings may help change the tabs to 2 spaces for ts files but not your other files.

https://forum.sublimetext.com/t/set-tab-size-for-different-file-type/6807/4

DesHorsley avatar Nov 03 '16 00:11 DesHorsley

I don't think there's a way to do that at the moment, but haven't investigated it much.

filipesilva avatar Nov 04 '16 16:11 filipesilva

@DesHorsley I can confirm that the CLI is not referencing the editorconfig for any code format

albandaft avatar Nov 04 '16 16:11 albandaft

Why is this ticket closed? It seems like a logical feature to have and I don't see any other issues mentioning this functionality.

mischkl avatar Nov 10 '16 12:11 mischkl

+1 for "why is this closed?" Two-space indentation is just.. ick.

Josh1billion avatar Nov 11 '16 20:11 Josh1billion

+1 I find this frustrating as well. I use WebStorm, and while I've got Webstorm setup to use 4 spaces for tabs, it also tries really hard to honor an existing file's pattern for tabs. This lack of capability in angular-cli makes me have to fight my editor whenever I use angular-cli, which I think goes against the whole point of the cli to begin with.

thardy avatar Nov 21 '16 15:11 thardy

Just want to throw in my +1 on having this option, reading from .editorconfig.

Additionally, it would be great to be able to use tab characters instead of spaces.

JustinSchneider avatar Dec 07 '16 18:12 JustinSchneider

+1 for bumping this issue.

nnennajohn avatar Dec 20 '16 08:12 nnennajohn

+1, having to change every file manually is tedious

amritk avatar Dec 30 '16 01:12 amritk

+1, seems like a fairly reasonable PR candidate

p-mcgowan avatar Dec 30 '16 01:12 p-mcgowan

+1, great tool but this problem is very frustrating

bcalou avatar Jan 05 '17 14:01 bcalou

+1, this would be really useful

federicofazzeri avatar Jan 10 '17 19:01 federicofazzeri

+1 for me as well!

pip-pipkin avatar Jan 13 '17 21:01 pip-pipkin

+1 for this. Very frustrating to edit the generated file every time for 4 spaces.

Why the ticket is closed btw?

Temetz avatar Jan 20 '17 12:01 Temetz

+1 for me as well, I'm not happy to reindent each newly created file.

psancho avatar Jan 23 '17 15:01 psancho

+1. Would be very happy if CLI could read from either .editorconfig or the angular-cli.json.

luvaas avatar Jan 24 '17 01:01 luvaas