WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

RE: [Xen-ia64-devel] Re: vimrc snippet

To: "Aron Griffis" <aron@xxxxxx>, <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-ia64-devel] Re: vimrc snippet
From: "Zhang, Xing Z" <xing.z.zhang@xxxxxxxxx>
Date: Wed, 19 Sep 2007 10:09:08 +0800
Delivery-date: Tue, 18 Sep 2007 19:09:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070918171347.GG8468@xxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070917142938.GB31631@xxxxxxxxx> <20070918171347.GG8468@xxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acf6F/77EX7n1J80Tb6bWO9A2+Z+ygASAp4g
Thread-topic: [Xen-ia64-devel] Re: vimrc snippet
Hi Aron:
        Adding script in .vimrc is convenient to us, but
how to the future contributors who have no configures
in their .vimrc? 
        Could we use mode-line? For example:

/* vim: set tabstop=4 shiftwidth=4 expandtab: */

We can add stuff liking above in every .c/.h files so that people
need not bother of .vimrc configures.

Good good study,day day up ! ^_^
-Wing(zhang xin)

OTC,Intel Corporation

>-----Original Message-----
>From: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx] On
>Behalf Of Aron Griffis
>Sent: 2007?9?19? 1:14
>To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [Xen-ia64-devel] Re: vimrc snippet
>
>Since I received two encouraging replies to my last post, and
>since
>Alex mentioned to me that the snippet can cause some confusing
>results
>without further vim configuration, here is a more complete
>configuration for general C coding.
>
>This can be cut-n-pasted directly into .vimrc
>
>   " Tabs and indents
>   set autoindent          " maintain current indent on newline
>   set shiftround          " round indent < and > to multiple of
>shiftwidth
>   set shiftwidth=4        " but see override in
>c_linux-kernel.vim
>   set smarttab            " use shiftwidth when inserting <Tab>
>   set tabstop=8           " number of spaces that <Tab> in file
>uses
>
>   " Important for working in hardlinked trees (e.g. git or
>mercurial)
>   set bkc+=breakhardlinks " always break hardlinks when
>writing
>
>   " Load filetype plugins
>   filetype plugin indent on
>   if has("syntax")
>       syntax on
>   endif
>
>   " Default options for C files
>   autocmd FileType c,cpp let b:c_gnu=1             " highlight
>gcc specific items
>   autocmd FileType c,cpp let b:c_space_errors=1    " highlight
>trailing w/s and spaces before tab
>   autocmd FileType c,cpp let b:c_no_curly_error=1  " don't
>highlight {} inside ()
>   autocmd FileType c     let g:c_syntax_for_h=1    " use C
>highlighting for header files
>   if has("cindent")
>       autocmd FileType c,cpp setl cin cino=(0,u0,t0,l1  "
>see :help cinoptions-values
>   endif
>
>   " Match precedent in file for tabs/spaces indentation
>   autocmd FileType c,cpp
>               \ let tabre = '^\t\|^\( \{8}\)' |
>               \ let foundtab = v:version >= 700 ?
>               \     search(tabre, 'cnpw', 1000) : search(tabre,
>'cnpw') |
>               \ if foundtab == 1 | setlocal noexpandtab |
>               \ elseif foundtab == 2 | setlocal expandtab | endif
>
>Additionally, I have two filetype plugins for working in the
>Linux
>kernel and working in Xen.  These set the shiftwidth (4 for xen,
>8 for
>Linux), include path (for example, for "gf"), tags location (use
>"make
>tags" at the top level) and cscope database (use "make cscope"
>at the
>top level).
>
>    $ mkdir ~/.vim/ftplugin
>    $ cd ~/.vim/ftplugin
>    $ wget
>http://n01se.net/agriffis/skel.hg/?raw-file/tip/vim/ftplugi
>n/c_linux-kernel.vim
>    $ wget
>http://n01se.net/agriffis/skel.hg/?raw-file/tip/vim/ftplugi
>n/c_xen.vim
>
>I'd appreciate any feedback.
>
>Thanks,
>Aron
>
>_______________________________________________
>Xen-ia64-devel mailing list
>Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-ia64-devel

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

<Prev in Thread] Current Thread [Next in Thread>