【手顺】常用IDE Tab改为空格的设置

徘徊边缘 提交于 2020-04-18 03:56:51

Sublime

Preferences
  -> Settings - User

{
  "draw_white_space": "all",
  "font_face": "YaHei Consolas Hybrid",
  "font_size": 11.0,
  "tab_size": 2,
  "translate_tabs_to_spaces": true
}
  1. Sublime Text 2 设置文件详解

VS2010

Tools
  -> Options
    -> Environment
      -> Fonts and Colors
        -> Font = YaHei Consolas Hybrid // 等宽字体
    -> Text Editor
      -> All Languages
        -> Tabs
          -> Tab size = 2, Indent size = 2 // 缩进为4
             Insert spaces // Tab为空格
Edit
  -> Advanced
    -> View White Space // 显示空白符
File
  -> Advanced Save Options
    -> Encoding: Unicode (UTF-8 without signature) – Codepage 65001
       Line endings: Unix (LF)
  1. UTF-8 without BOM
  2. How to: Manage Files By Using Encoding

CmdOutput

Tools
  -> External Tools
    -> Add
      -> Title:     CmdOutput
         Command:   %systemroot%\system32\cmd.exe
         Arguments: /c $(TargetPath)
         Use Output window: checked

QtCreator

Tools
  -> Options
    -> Text Editor
      -> Font & Colors
        -> Family = YaHei Consolas Hybrid // 等宽字体
      -> Behavior
        -> Tab policy: Space Only
           Tab size: 2
           Indent size: 2
      -> Display
        -> Display right margin at column: 80
           Visualize whitespace // 显示空白符
    -> C++
      -> Copy/Edit
        -> Code Style
          -> Tab policy: Space Only
             Tab size: 2
             Indent size: 2
        -> File Naming
          -> Header suffix: h
             Source suffix: cc
    -> Qt Quick
      -> Copy/Edit
        -> Code Style
          -> Tab policy: Space Only
             Tab size: 2
             Indent size: 2
  1. Indenting Text or Codem

Eclipse

Project
  -> Build Automatically // 取消自动编译(个人习惯)
  -> Clean...
    -> Clean projects selected below // 选此(个人习惯)
       Start a build immediately // 取消(个人习惯)

Windows
  -> Preferences
    -> General
      -> Appearance
        -> Colors and Fonts
          -> Basic
            -> Text Font
              -> Font = YaHei Consolas Hybrid // 等宽字体
      -> Editors
        -> Text Editors
          -> Insert spaces for tabs
             Show whitespace characters // 显示空白符(工具条有快捷键)
      -> Workspace
        -> Text file encoding = UTF-8 // 文件编码 (不同工作环境)
           New text file line delimiter = Unix // 新建文件的行分隔符 (不同工作环境)
      -> Content Types // 不同文件的默认编码
    -> Java
      -> Code Style
        -> Formatter
          -> Edit/New
            -> Indentation
              -> Tab policy = Spaces only // Tab为空格
                 Indentation size: 2 // 缩进大小为2
                 Tab size: 2 // Tab大小为2
            -> Line Wrapping
              -> Maximum line width = 80 // 最大行字符数
            -> Comments
              -> disable all // 禁用注释格式化(个人习惯)
      -> Installed JREs = JDK路径 // Ant编译时需要javac
    -> Ant
      -> Editor
        -> Formatter
          -> Tab size: 2 // Tab大小为2
             Use tab character instead of spaces // 取消
    -> C/C++
      -> Code Style
        -> Edit/New
          -> Identation
            -> Tab policy = Spaces only // Tab为空格
               Indentation size: 2 // 缩进大小为2
               Tab size: 2 // Tab大小为2
      -> Indexer
        -> Enable indexer
    -> JavaScript
      -> Code Style
        -> Formatter
          -> Edit/New
            -> Identation
              -> Tab policy = Spaces only // Tab为空格
                 Indentation size: 2 // 缩进大小为2
                 Tab size: 2 // Tab大小为2
            -> Comments
              -> disable all // 禁用注释格式化(个人习惯)
    -> Web
      -> CSS Files
        -> Editor
          -> Indent using spaces // 缩进为空格
             Indentation size = 2 // 缩进为2
      -> HTML Files
        -> Editor
          -> Indent using spaces // 缩进为空格
             Indentation size = 2 // 缩进为2
  1. Eclipse全UTF-8的环境
    1. 在eclipse.ini的-vmargs下面加上「-Dfile.encoding=UTF-8」
    2. eclipse-->Window-->Preferences-->General-->Workspace-->Text file encoding-->UTF-8
    3. Installed JREs-->Default VM Arguments:-->-Dfile.encoding=UTF-8
    4. eclipse-->Run-->Run Configurations-->Arguments-->VM arguments-->-Dfile.encoding=UTF-8
    5. eclipse-->Run-->Run Configuration-->Common 頁籤-->Console Encoding-->Others-->UTF-8
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!