Atom - Force Tab Width 2

I just switched from Sublime Text to Atom to enable fully open source.

I have problems with something very simple: I want Atom to always use (!) And under any circumstances, tab width 2 and replace the tab with spaces. This option is very simple in gedit or Sublime Text, but no matter what I try: When I start a new file, the tab size is 2 (good!). When I use an existing file, the tab size is sometimes 4. I find this a bit annoying.

My current settings in the editor are visible in the screenshot:

enter image description here

+7
source share
3 answers

There is more than one tab setting

(, Python-) . , , , .

" " "". , . 2. .

, "" "python", "language-python". , , .

  • Python
  • Python Console
  • Python
  • (Python)

. 2, . (, , , Python.)

Python 4 , , Python , PEP 8 4 . :

https://github.com/atom/language-python/blob/master/settings/language-python.cson

'autoIndentOnPaste': false
'softTabs': true
'tabLength': 4

. Python Grammar , .

, . , language-make , make.

Python . language-python , . (, , , Python .)

,

, , Atom. Window: Reload . :

  • Mac: Ctrl Opt Cmd L
  • Windows/Linux: Ctrl Alt R
+7

, .

  • ~/.atom/config.cson ( , "*" )

:

".python.source":
  editor:
    autoIndent: true
    tabLength: 2
  1. .

- . . .

+1

soham, , tabLength: ~/.atom/config.cson ( , osx) .

0

Source: https://habr.com/ru/post/1669046/


All Articles