Tell vim to use spaces instead of tabs for all files residing under xen-unstable.hg. Must open files from the top-level directory, otherwise it doesn''t work. Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com> diff -r 9dc729b75595 -r f32959a0c147 .vimrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.vimrc Wed Sep 05 17:29:54 2012 +0100 @@ -0,0 +1,8 @@ +" Makes vim use spaces instead of tabs for all files under xen-unstable.hg. +" Caveat: files must be opened from the top-level directory for it to work. +" Must set the following in your ~/.vimrc: +" set exrc +" set secure +set tabstop=4 +set shiftwidth=4 +set expandtab
Thanos Makatos writes ("[Xen-devel] [PATCH] use spaces instead of tabs in vim"):> Tell vim to use spaces instead of tabs for all files residing under > xen-unstable.hg. Must open files from the top-level directory, otherwise it > doesn''t work.This is fine by me and looks plausible but I''d like to see a second opinion from someone who uses vim. Ian.
On Thu, 13 Sep 2012, Ian Jackson wrote:> Thanos Makatos writes ("[Xen-devel] [PATCH] use spaces instead of tabs in vim"): > > Tell vim to use spaces instead of tabs for all files residing under > > xen-unstable.hg. Must open files from the top-level directory, otherwise it > > doesn''t work. > > This is fine by me and looks plausible but I''d like to see a second > opinion from someone who uses vim. >Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
On Thu, 2012-09-13 at 18:58 +0100, Stefano Stabellini wrote:> On Thu, 13 Sep 2012, Ian Jackson wrote: > > Thanos Makatos writes ("[Xen-devel] [PATCH] use spaces instead of tabs in vim"): > > > Tell vim to use spaces instead of tabs for all files residing under > > > xen-unstable.hg. Must open files from the top-level directory, otherwise it > > > doesn''t work. > > > > This is fine by me and looks plausible but I''d like to see a second > > opinion from someone who uses vim. > > > > Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>http://vim.wikia.com/wiki/Modeline_magic suggests you can do it on a per-file basis. Given the number of different coding styles throughout the tree wouldn''t that be a better option? This set of options is wrong e.g. for tools/libxl and anything imported from Linux. It''s be a bigger initial patch but once it is done it''s done. People typically copy the magic block from an existing file so as long as you put the vim one next to the emacs one it should get propagated as necessary to new files. Ian.
On Fri, 14 Sep 2012, Ian Campbell wrote:> On Thu, 2012-09-13 at 18:58 +0100, Stefano Stabellini wrote: > > On Thu, 13 Sep 2012, Ian Jackson wrote: > > > Thanos Makatos writes ("[Xen-devel] [PATCH] use spaces instead of tabs in vim"): > > > > Tell vim to use spaces instead of tabs for all files residing under > > > > xen-unstable.hg. Must open files from the top-level directory, otherwise it > > > > doesn''t work. > > > > > > This is fine by me and looks plausible but I''d like to see a second > > > opinion from someone who uses vim. > > > > > > > Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > > http://vim.wikia.com/wiki/Modeline_magic suggests you can do it on a > per-file basis. Given the number of different coding styles throughout > the tree wouldn''t that be a better option?I agree that would be a better option.> This set of options is wrong > e.g. for tools/libxl and anything imported from Linux.That''s right, it would be wrong for Linux, but I think it is correct for libxl and QEMU (both use 4 whitespaces for indentation), so in practice it should be correct for anything under xen-unstable except Makefiles and stuff imported as-is from Linux (xen/arch/arm/lib/* for example). Better than nothing :)> It''s be a bigger initial patch but once it is done it''s done. > > People typically copy the magic block from an existing file so as long > as you put the vim one next to the emacs one it should get propagated as > necessary to new files.
Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] use spaces instead of tabs in vim"):> That''s right, it would be wrong for Linux, but I think it is correct for > libxl and QEMU (both use 4 whitespaces for indentation), so in practice it > should be correct for anything under xen-unstable except Makefiles and > stuff imported as-is from Linux (xen/arch/arm/lib/* for example). Better > than nothing :)On that basis, it should go in, I think. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Ian.