[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 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.

>  
> +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.

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?

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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