Article View: cn.comp.os.linux
Article #10146[comp.emacs] Re: Why emacs? -- Vim Indent/Code_Beatify Functions
From: It's me FKtPp ;)
Date: Mon, 25 Aug 2003 09:52
Date: Mon, 25 Aug 2003 09:52
102 lines
4565 bytes
4565 bytes
--=-=-=
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit
������Ӳ�֪����ҿ���� ;P Emacs�Ĺ���info���潲�ġ��ݡ�����������
�жԱȰɣ���֮һ�仰��vim��emacs���DZ�̬��ǿ������
--=-=-=
Content-Type: message/rfc822
Content-Disposition: inline
Path:
news.yaako.com!news.cn99.com!news.happynet.org!news.neu.edu.cn!news3.optonline.net!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!p59.c5351.sinor.RU!not-for-mail
From: Ivan Boldyrev <boldyrev+nospam@cgitftp.uiggm.nsc.ru> Newsgroups:
comp.emacs Subject: Re: Why emacs? Followup-To: comp.editors Date:
Sat, 23 Aug 2003 13:26:43 +0700 Organization: this field is
intentionally left blank Message-ID:
<32ej11xc58.ln2@elaleph.borges.cgitftp.uiggm.nsc.ru>
References: <bguo2g$koh$1@news-reader5.wanadoo.fr>
<x58yq5av8x.fsf@lola.goethe.zz>
<bgup71$7eg$1@news-reader4.wanadoo.fr> <uadak9088.fsf@swbell.net>
<slrnbj8sgb.9ej.cmenzel@philebus.tamu.edu>
<x5y8y3a278.fsf@lola.goethe.zz>
<he4h01xh1l.ln2@elaleph.borges.cgitftp.uiggm.nsc.ru>
<87oeyswe8r.fsf@isd.dp.ua>
<ac6de390.0308150407.aa55731@posting.google.com>
<874r0aypfa.fsf@isd.dp.ua>
NNTP-Posting-Host: p59.c5351.sinor.ru (217.70.111.59) X-Trace:
news.uni-berlin.de 1061661870 6749809 217.70.111.59 (16 [186134])
X-Orig-Path: elaleph.borges.cgitftp.uiggm.nsc.ru!not-for-mail
X-Comment-To: Serge Olkhowik X-Request-PGP:
hkp://wwwkeys.eu.pgp.net:11371 X-PGP-KeyID: 0xA5BDD19856098673 (1024D)
X-PGP-Fingerprint: 3640 E637 EE3D AA51 A59F 3306 A5BD D198 5609 8673
X-Face:
PH}*k.3oBVs#UXxo9T/`6!vlSI.1C@7ht0^wH,DeRlG\)j3v:@^jABw--/o=BTWpuau^vQM
]WU)p;0L%v?QTVD%s^Cy#D User-Agent: Gnus/5.1002 (Gnus v5.10.2)
Emacs/21.3 (gnu/linux)
MIME-Version: 1.0
On 8478 day of my life Serge Olkhowik wrote:
> On 15 Aug 2003 05:07:06 -0700
> Antony (Antony) wrote:
>
> >> And what about *intelligent* indentation? I like emacs for this
> >> feature most of all other ;)
>
> Antony> If you mean automatic indentation based on the current
> Antony> filetype, then yes. If you mean indentation based on the
> Antony> previous line's indentation, then yes.
>
> Does vim use spaces for indentation? I don't like tab symbols.
Set expandtab.
There are number of vim variables controlling indentation.
> Can vim select indentation style?
Set cinoptions for C.
You can edit indentation files for other languages.
> And please tell me the key sequence to reindent some C++ code
> region. I'll try it and compare ;)
======================================================================
When you have code that is badly formatted, or you inserted and
deleted lines, you need to re-indent the lines. The "=" operator does
this. The simplest form is:
==
This indents the current line. Like with all operators, there are
three ways to use it. In Visual mode "=" indents the selected lines.
A useful text object is "a{" This selects the current {} block. Thus,
to re-indent the code code block the cursor is in:
=a{
I you have really badly indented code, you can re-indent the whole
file with:
gg=G
======================================================================
--
Ivan Boldyrev
XML -- new language of ML
family.
--=-=-=
--
Lisp Lisp Lisp Lisp Lisp Lisp Lisp Lisp Lisp Lisp
--=-=-=--
Technical Details
Message-ID:
<u8ypi15qk.fsf@yahoo.com.cn>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!news.cn99.com!news.yaako.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: 10b277,f433ca269a3fc38f,start X-Google-Attributes: gid10b277,public X-Google-ArrivalTime: 2003-08-25 02:52:13 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!news.cn99.com!news.yaako.com!not-for-mail From: "It's me FKtPp ;)" <m_pupil@yahoo.com.cn> Newsgroups: cn.comp.os.linux Subject: [comp.emacs] Re: Why emacs? -- Vim Indent/Code_Beatify Functions Date: Mon, 25 Aug 2003 17:52:05 +0800 Organization: Bentium Ltd. (CN99) Lines: 102 Message-ID: <u8ypi15qk.fsf@yahoo.com.cn> NNTP-Posting-Host: 61.134.142.24 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: news.yaako.com 1061804958 615 61.134.142.24 (25 Aug 2003 09:49:18 GMT) X-Complaints-To: usenet@news.yaako.com NNTP-Posting-Date: Mon, 25 Aug 2003 09:49:18 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt)