Android Studio 禁用换行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20882044/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:38:23  来源:igfitidea点击:

Android Studio disable line wrap

androidandroid-studio

提问by joseRo

I have this strange line wrap on Android Studio and I want to disable because it freaks me out...

我在 Android Studio 上有这个奇怪的换行符,我想禁用它,因为它吓坏了我......

enter image description here

在此处输入图片说明

回答by mes

It's also available under the context menu enter image description here

它也可以在上下文菜单下使用 在此处输入图片说明

回答by ozbek

In Android Studio 0.4.0 following should help:

在 Android Studio 0.4.0 以下应该有所帮助:

Configure > Settings > Editor > Uncheck 'Use soft wraps in editor'

Screenshot from Android Studio 0.4.0 Settings screen

Android Studio 0.4.0 设置屏幕截图

On Mac (Android Studio 3.0):

在 Mac(Android Studio 3.0)上:

Preferences -> Editor -> General -> Uncheck 'Use soft wraps in editor'

回答by Attacktive

I wanted to entirelydisable wrapping and I found a workaround.

我想完全禁用包装,我找到了一个解决方法。

enter image description here

在此处输入图片说明

It doesn't seem to work for specific file extensions (Groovy, HTML, Java, etc.) but does with the general value. I set it with a significantly great number and am having no more wrapping.

它似乎不适用于特定的文件扩展名(Groovy、HTML、Java 等),但适用于一般值。我设置了一个非常大的数字并且没有更多的包装。

I think they should give a master option for it!

我认为他们应该给它一个主选项!

回答by Ratul

In Android Studio 1.0.2, there is no menu named Configure. Settingsis now under Filemenu. Everything are as accepted answer.

在 Android Studio 1.0.2 中,没有名为Configure 的菜单。设置现在位于文件菜单下。一切都是公认的答案。

回答by mrfilter

In Android Studio 2.3.3+, to disable line wrapping, you need to go to:

在 Android Studio 2.3.3+ 中,要禁用换行,您需要转到:

  • Preferences
    • Code Styles
      • [Select a Language, e.g. Java]
      • Set "wrap on typing" to NO.
  • 喜好
    • 代码样式
      • [选择一种语言,例如 Java]
      • 将“打字时换行”设置为否。

enter image description here

在此处输入图片说明

回答by Sethuraman Srinivasan

Right click near the line numbers for the soft wrap option to pop up.

在弹出软换行选项的行号附近右键单击。

enter image description here

在此处输入图片说明

回答by Brian Mc

In Android Studio 3.5.3 you can set the soft wrap to line up with the orginal lines indentAND set an additional indent spaces. Makes it easier for me to read Settings --> Editor --> General

在 Android Studio 3.5.3 中,您可以将软换设置为与原始行缩进对齐并设置额外的缩进空格。让我更容易阅读设置 --> 编辑器 --> 常规

settings screenshot

设置截图

回答by Rodrirokr

I found helpful that in the current version (Android Studio 3.2) you can set the soft wrapindicators to show only in the current line in adition to using soft wraps in editor.

我发现在当前版本 (Android Studio 3.2)中,除了在编辑器中使用软包装外,您还可以将软包装指示器设置为仅显示在当前行中。

Check the Show soft wrap indicators for current line onlyin:

选中在以下位置显示当前行的软换行指示器

Editor -> General -> Soft Wraps

Editor -> General -> Soft Wraps

enter image description here

在此处输入图片说明

回答by Chris Paveglio

There is also the auto-line breaking issue, where AS will automatically add hard line returns in long lines. I found the setting for this in Preferences > Editor > Code Style > Hard wrap at [X] and []wrap on typing.

还有自动换行问题,AS 会自动在长行中添加硬线回车。我在 Preferences > Editor > Code Style > Hard wrap at [X] 和 []wrap on typing 中找到了这个设置。