Redian新闻
>
大侠,请问如何在VI和XEMACS中对齐程序?
avatar
大侠,请问如何在VI和XEMACS中对齐程序?# Unix - 噫吁兮,危乎高哉
j*s
1
我按TAB键,但有时上下对不齐,不知是何原因?
挺麻烦的!
各位是如何处理的?
谢谢!
avatar
t*a
2
in vi, you can just enable autoindent and everything will go nicely
in emacs, things could be messed up. then you need to select the text you wanna
indent and M-x indent-region

【在 j****s 的大作中提到】
: 我按TAB键,但有时上下对不齐,不知是何原因?
: 挺麻烦的!
: 各位是如何处理的?
: 谢谢!

avatar
j*s
3
Hi, thanks.
But in vi, how can Ienable that one?
I mean when I program, I always put some time on the format which I should not
spend time on it.
I would prefer my program is easy to read, with a good format.
I did it easily in BC3.1 in dos, but seems sth wrong in unix.

【在 t*******a 的大作中提到】
: in vi, you can just enable autoindent and everything will go nicely
: in emacs, things could be messed up. then you need to select the text you wanna
: indent and M-x indent-region

avatar
bz
4
user expand or indent when you think you feel it is the right time to do it.

【在 j****s 的大作中提到】
: Hi, thanks.
: But in vi, how can Ienable that one?
: I mean when I program, I always put some time on the format which I should not
: spend time on it.
: I would prefer my program is easy to read, with a good format.
: I did it easily in BC3.1 in dos, but seems sth wrong in unix.

avatar
q*e
5
Better use vim, I am not sure whether autoindent or smartindent
is standard vi feature or vim extended feature. Anyway, vim provide
more nice feature for programming.

【在 bz 的大作中提到】
: user expand or indent when you think you feel it is the right time to do it.
avatar
i*r
6
If you using linux, Just man indent
then using indent to take over it :)

【在 j****s 的大作中提到】
: 我按TAB键,但有时上下对不齐,不知是何原因?
: 挺麻烦的!
: 各位是如何处理的?
: 谢谢!

avatar
w*g
7
My xemacs works ok and I really like it, :-)

【在 j****s 的大作中提到】
: 我按TAB键,但有时上下对不齐,不知是何原因?
: 挺麻烦的!
: 各位是如何处理的?
: 谢谢!

avatar
i*e
8
Use emacs, so that you can use it under a text terminal as well. :)

【在 w*******g 的大作中提到】
: My xemacs works ok and I really like it, :-)
avatar
j*s
9
Thanks all!!!
And I remember vim can display color for C program. But I do not know how.
How can I know the feature of vim?
Thanks

【在 q***e 的大作中提到】
: Better use vim, I am not sure whether autoindent or smartindent
: is standard vi feature or vim extended feature. Anyway, vim provide
: more nice feature for programming.

avatar
g*t
10
In vim you just hit the following key in the command mode.
your file format will autoindented and saved,
gg=G:w
and following key to display color,
and following key to know the feature of vim,
avatar
j*s
11
Thanks so many! :-)

【在 g*****t 的大作中提到】
: In vim you just hit the following key in the command mode.
: your file format will autoindented and saved,
: gg=G:w
: and following key to display color,
: and following key to know the feature of vim,

avatar
w*g
12
That is really cool...

【在 g*****t 的大作中提到】
: In vim you just hit the following key in the command mode.
: your file format will autoindented and saved,
: gg=G:w
: and following key to display color,
: and following key to know the feature of vim,

avatar
D*g
13
vim可不可以用空格instead of tab?我在windows下总是用空格,tab很烦人
没个editor解释都不一样.而且,我缩进都是四格.

【在 q***e 的大作中提到】
: Better use vim, I am not sure whether autoindent or smartindent
: is standard vi feature or vim extended feature. Anyway, vim provide
: more nice feature for programming.

avatar
j*g
14
set expandtab
set smarttab
set ts=4

【在 D****g 的大作中提到】
: vim可不可以用空格instead of tab?我在windows下总是用空格,tab很烦人
: 没个editor解释都不一样.而且,我缩进都是四格.

avatar
j*s
15
why "gg=G:w" cannot work?
IT said no such command.
I press : first, then type that.
I do not know why.
Thanks

【在 g*****t 的大作中提到】
: In vim you just hit the following key in the command mode.
: your file format will autoindented and saved,
: gg=G:w
: and following key to display color,
: and following key to know the feature of vim,

avatar
p*f
16

no : needed.

【在 j****s 的大作中提到】
: why "gg=G:w" cannot work?
: IT said no such command.
: I press : first, then type that.
: I do not know why.
: Thanks

avatar
w*e
17
The way I like Xemacs is that it can do great job in automatic indenting.
Place your cursor on the start "{", and press ctrl+alt+q all together. It will
indent the whole region to your matching "}".

【在 p******f 的大作中提到】
:
: no : needed.

avatar
w*g
18
I like that too. Another feature I like is that it can turn all the keywords
in my F90 code into Capital...

【在 w******e 的大作中提到】
: The way I like Xemacs is that it can do great job in automatic indenting.
: Place your cursor on the start "{", and press ctrl+alt+q all together. It will
: indent the whole region to your matching "}".

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。