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

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

 



On Wed, Mar 16, 2011 at 09:11:25AM -0600, Eric Blake wrote:
> On 03/16/2011 04:01 AM, Hu Tao wrote:
> > ---
> > 
> > What about this one?
> > 
> > 
> >  HACKING |   16 ++++++++++++++++
> >  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> HACKING is generated.  Edit docs/hacking.html.in instead.

Thanks for reminding me.

> 
> >  
> > +If you use vim, append the following to your ~/.vimrc file:
> > +
> > +  set nocompatible
> > +  filetype on
> > +  set autoindent
> > +  set smartindent
> > +  set cindent
> > +  set tabstop=8
> > +  set shiftwidth=4
> > +  set expandtab
> > +  set cinoptions=(0,:0,l1,t0
> > +  filetype plugin indent on
> > +  au FileType make setlocal noexpandtab
> > +  au BufRead,BufNewFile *.am setlocal noexpandtab
> > +  match ErrorMsg /\s\+$\| \+\ze\t/
> 
> You may also want to mention how to install .lvimrc files and use the
> script from http://www.vim.org/scripts/script.php?script_id=1408 (it is
> possible to 'echo .lvimrc >> .git/info/exclude' to avoid accidentally
> commiting it), even if we don't push .lvimrc into the repository.

OK, will update.

> 
> Is there any way to make configuration of tabstop/expandtab conditional
> based on whether the file is a Makefile or something else, so that you
> can continue to use proper TABs where they are required?

The two ^au lines do this.

-- 
Thanks,
Hu Tao

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]