缩进级别的困境 [英] Indentation level woes

查看:130
本文介绍了缩进级别的困境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




经过大量使用价值8个空格的标签后,不断地用
格式化我的C ++代码,以有趣的方式保持所有内容一个80

字符行长度限制,我正在认真考虑切换

到每个标签使用4个空格。我觉得我要失去一个长期痛苦的忠实伴侣...


您对此有何看法?任何同情的话? :0)


谢谢,

Asfand Yar


-
http://www.it-is-truth.org/

解决方案

Asfand Yar Qazi写道:



经过大量使用价值8个空格的标签后,不断拥有以有趣的方式格式化我的C ++代码,以保持所有行在80个字符行内的长度限制,我正在认真考虑切换到每个
选项卡使用4个空格。我觉得我要失去一个长期痛苦的忠实伴侣......

您对此有何看法?任何同情的话? :0)




八列标签几乎就是我们所有标准化的b
。这并不总是方便,但挂在那里,男人;

保存八列标签。 :)


我的解决方案是使用空格而不是制表符。 Vim帮了很多钱;它具有shiftwidth的概念。这使编辑器表现为

虽然tab是四个空格,但^我实际上插入空格而不是

制表符。实际制表位仍设置为八列间隔。在我以前使用的

emacs模式中,tab只是根据

对齐当前行,你可以设置一些变量来控制缩进。


>八列标签几乎就是我们所有

标准化的标签。这并不总是方便,但挂在那里,男人;
保存八列标签。 :)

我的解决方案是使用空格而不是制表符。 Vim已帮助了很多;它具有shiftwidth的概念。这使得编辑器表现为
虽然tab是四个空格,但是^我实际上是插入空格而不是
标签。实际制表位仍设置为八列间隔。在我以前使用的emacs模式中,tab只是根据你可以设置的一些变量控制缩进来对齐当前行。




我没有正确地说出我原来的意图:我提议

和你一样,那就像emacs中所知的'基本偏移'是

4个空格,每当8个空格相互同时,

它们就会变成一个标签。


为什么我很伤心,因为使用了''

的8个空格的基本偏移''这么久,我想要移动到4个空格的基本偏移

就像Java(呃。)


感谢您的鼓励:0)

-
http://www.it-is-truth.org/


Asfand Yar Qazi写道:

八列标签几乎是我们所有人都能做到的事情标准化。这并不总是方便,但挂在那里,男人;
保存八列标签。 :)

我的解决方案是使用空格而不是制表符。 Vim已帮助了很多;它具有shiftwidth的概念。这使得编辑器表现为
虽然tab是四个空格,但是^我实际上是插入空格而不是
标签。实际制表位仍设置为八列间隔。在我以前使用的emacs模式中,tab只是将当前行与
对齐,你可以设置一些变量来控制缩进。



我没有''我正确地说出了我原来的意图:我提出了和你一样的东西,就像在emacs中已知的那样,'基本偏移'是4个空格,
每当有8个空格并发另外,它们成为一个标签。

为什么我很难过,因为长时间使用了8个空格的基本偏移后,我想要搬到像Java一样基本偏移4个空格(呃。)

感谢鼓励:0)




啊,我明白了。好吧,想想你将保存的所有换行!


Hi,

After much use of tabs worth 8 spaces, and constantly having to
format my C++ code in funny ways to keep all lines within an 80
character line length limit, I''m seriously thinking of switching
to using 4 spaces per tab. I feel like I''m about to lose a a
long suffering faithful companion...

What are your views on this? Any words of sympathy? :0)

Thanks,
Asfand Yar

--
http://www.it-is-truth.org/

解决方案

Asfand Yar Qazi wrote:

Hi,

After much use of tabs worth 8 spaces, and constantly having to format
my C++ code in funny ways to keep all lines within an 80 character line
length limit, I''m seriously thinking of switching to using 4 spaces per
tab. I feel like I''m about to lose a a long suffering faithful
companion...

What are your views on this? Any words of sympathy? :0)



Eight-column tabs are pretty much the one thing on which we''ve all
standardized. This isn''t always convenient, but hang in there, man;
save the eight-column tab. :)

My solution has been to use spaces instead of tabs. Vim has helped a
lot; it has a concept of "shiftwidth" that makes the editor behave as
though tab were four spaces, but ^I actually inserts spaces instead of
tabs. Real tab stops are still set at eight-column intervals. In the
emacs modes I used to use, tab just aligns the current line according to
some variables you can set to control indentation.


> Eight-column tabs are pretty much the one thing on which we''ve all

standardized. This isn''t always convenient, but hang in there, man;
save the eight-column tab. :)

My solution has been to use spaces instead of tabs. Vim has helped a
lot; it has a concept of "shiftwidth" that makes the editor behave as
though tab were four spaces, but ^I actually inserts spaces instead of
tabs. Real tab stops are still set at eight-column intervals. In the
emacs modes I used to use, tab just aligns the current line according to
some variables you can set to control indentation.



I didn''t word my original intent correctly: I was proposing the
same thing as you, that ''basic-offset'' as its known in emacs, is
4 spaces, and whenever 8 spaces are concurrent to each other,
they become a tab.

Why I am sad is that after using a ''basic-offset'' of 8 spaces for
so long, I''m thinking of moving to a basic-offset of 4 spaces
like Java (ugh.)

Thanks for the encouragement :0)
--
http://www.it-is-truth.org/


Asfand Yar Qazi wrote:

Eight-column tabs are pretty much the one thing on which we''ve all
standardized. This isn''t always convenient, but hang in there, man;
save the eight-column tab. :)

My solution has been to use spaces instead of tabs. Vim has helped a
lot; it has a concept of "shiftwidth" that makes the editor behave as
though tab were four spaces, but ^I actually inserts spaces instead of
tabs. Real tab stops are still set at eight-column intervals. In the
emacs modes I used to use, tab just aligns the current line according
to some variables you can set to control indentation.


I didn''t word my original intent correctly: I was proposing the same
thing as you, that ''basic-offset'' as its known in emacs, is 4 spaces,
and whenever 8 spaces are concurrent to each other, they become a tab.

Why I am sad is that after using a ''basic-offset'' of 8 spaces for so
long, I''m thinking of moving to a basic-offset of 4 spaces like Java (ugh.)

Thanks for the encouragement :0)



Ah, I see. Well, just think of all the line-wrapping you''ll save!


这篇关于缩进级别的困境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆