[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Add vim configuration that makes vim auto-indent code



On Wed, Mar 16, 2011 at 04:59:11PM +0800, Hu Tao wrote:
> On Wed, Mar 16, 2011 at 03:54:26PM +0800, Daniel Veillard wrote:
> > On Wed, Mar 16, 2011 at 10:53:27AM +0800, Hu Tao wrote:
> > > ---
> > >  .lvimrc |   10 ++++++++++
> > >  HACKING |    5 +++++
> > >  2 files changed, 15 insertions(+), 0 deletions(-)
> > >  create mode 100644 .lvimrc
> > > 
> > > diff --git a/.lvimrc b/.lvimrc
> > > new file mode 100644
> > > index 0000000..3a732ce
> > > --- /dev/null
> > > +++ b/.lvimrc
> > > @@ -0,0 +1,10 @@
> > > +set nocompatible
> > > +filetype on
> > > +set autoindent
> > > +set smartindent
> > > +set cindent
> > > +set tabstop=4
> > > +set shiftwidth=4
> > > +set expandtab
> > > +set cinoptions=(0,:0,l1,t0
> > > +filetype plugin indent on
> > > diff --git a/HACKING b/HACKING
> > > index 4a71b37..adfb7ae 100644
> > 
> >   Heh, I use vim, but I would rather not put a configuration file in the
> > tree, especially with autoindent which may defeat people typing habits.
> 
> Agree. But do you think the script (see changes of HACKING file of this
> patch) is useful? with it the .lvimrc(not .vimrc) takes effect only if
> editing libvirt code, and there is no need to append it to ~/.vimrc.

  I tend to think it's a bit too specific. I would be fine with just
  adding instruction and the example file in HACKING however :-)

> > let c_space_errors=1
> > highlight RedundantSpaces ctermbg=red guibg=red
> > match RedundantSpaces /\s\+$\| \+\ze\t/
> > 
> >   BTW the last lines shows up in red any trailing spaces left at the end
> > of lines, tip given by Jim Meyering a couple of years ago
> 
> Thank you, it helps catching trailing spaces early in vim. (although git
> diff can do it)

  Yeah but it's nicer to catch them at creation time, though he extra
red blocks on the editors need some time to get used too,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]