sublime 3 tabs and spaces do not match

徘徊边缘 提交于 2019-12-12 03:48:22

问题


I have browsed the web 3 times over but still no solution.

I have a simple js file, and I want my tabs to be 4 spaces instead of 2.

I changed the preferences settings to tab size to be 4, chaged syntax specific settings, everything, but still same issue.

any ideas?


回答1:


Click On the indentation information on the status bar, that's where it says either Tab Size: num or Spaces: num, and a context menu will be displayed.

Assuming the starting position of a file using indentation with spaces and a width of 2, follow the following procedure to convert to indentation with spaces and a width of 4.

Convert from spaces to tabs, change the width, and then convert back to spaces, like this:

  • Un-Tick: Indent Using Spaces
  • Click: Convert Indentation to Tabs
  • Tick: Tab Width: 4
  • Tick: Indent Using Spaces
  • Click: Convert Indentation to Spaces
  • That's it. :)

If indenting with spaces with a width of 4 is what you want to use by default in all your files, then set these settings in your user preferences and bear in mind that they can be overridden by your project settings and syntax specific settings:

// The number of spaces a tab is considered equal to
"tab_size": 4,

// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,


来源:https://stackoverflow.com/questions/40566871/sublime-3-tabs-and-spaces-do-not-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!