Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 461314

Summary: app-editors/vim-core - vimrc autocmd violates global options
Product: Gentoo Linux Reporter: ujihisa
Component: Current packagesAssignee: Oskari Pirhonen <xxc3ncoredxx>
Status: CONFIRMED ---    
Severity: normal CC: kfm, proxy-maint, vim
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=559800
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch for files/vimrc-r3
patch for files/vimrc-r4

Description ujihisa 2013-03-10 23:19:16 UTC
files/vimrc-r[34], which eventually become /etc/vim/vimrc, have "set" in autocmd FileType, BufRead, and BufNewFile. Unless they use "setlocal" instead of "set", the option values dynamically change globally that users don't expect.

Reproducible: Always

Steps to Reproduce:
1. write "set shiftwidth=2" in your ~/.vimrc
2. open a file ends with .ebuild. ":echo &sw" will be 4 which is fine.
3. open another buffer like by ":new"
4. ":echo &sw"
Actual Results:  
4

Expected Results:  
2
Comment 1 ujihisa 2013-03-10 23:21:14 UTC
Created attachment 341620 [details, diff]
patch for files/vimrc-r3
Comment 2 ujihisa 2013-03-10 23:21:38 UTC
Created attachment 341622 [details, diff]
patch for files/vimrc-r4
Comment 3 ujihisa 2013-03-10 23:21:59 UTC
the patches attached should solve this issue.