Re: Vim config problem in jessie
- To: debian-user@lists.debian.org
- Subject: Re: Vim config problem in jessie
- From: Jeremiah Mahler <jmmahler@gmail.com>
- Date: Fri, 14 Feb 2014 20:36:49 -0800
- Message-id: <20140215043649.GA31020@hudson.localdomain>
- In-reply-to: <ldmp2s$dgr$1@dont-email.me>
- References: <ldlnld$j3j$1@dont-email.me> <20140214194000.GA21221@hudson.localdomain> <ldltta$1lt$1@dont-email.me> <20140214220706.GA25258@hudson.localdomain> <ldm65j$i5r$1@dont-email.me> <20140214235833.GA27877@hudson.localdomain> <ldmp2s$dgr$1@dont-email.me>
On Sat, Feb 15, 2014 at 04:05:48AM +0000, Frank Miles wrote:
> On Sat, 15 Feb 2014 01:00:01 +0100, Jeremiah Mahler wrote:
>
> > On Fri, Feb 14, 2014 at 10:42:59PM +0000, Frank Miles wrote:
> >> On Fri, 14 Feb 2014 23:10:01 +0100, Jeremiah Mahler wrote:
> >>
> >> > On Fri, Feb 14, 2014 at 08:22:02PM +0000, Frank Miles wrote:
> >> >> On Fri, 14 Feb 2014 20:50:01 +0100, Jeremiah Mahler wrote:
> >> >>
> >> >> > On Fri, Feb 14, 2014 at 06:35:25PM +0000, Frank Miles wrote:
> >> >> >> I'm having problems setting the vim configuration -
> >> >> >> and having it mean something - in a fairly new computer.
> >> >> >> One simple example is the tab stops. Since I'm the only direct
> >> >> >> user of this machine, I've simply edited /etc/vim/vimrc, where I
> >> >> >> have the line:
> >> >> >> set tabstop=4
> >> >> >> In addition, I've appended the line
> >> >> >> set ts=4
> >> >> >> to some of the 'plugin' files, for example:
> >> >> >> /usr/share/vim/vim74/syntax/python.vim
> >> >
> >> > The only entry in my ..syntax/pthon.vim with ts=8 is the modeline at
> >> > the bottom. This would only have an effect with python.vim is
> >> > opened.
> >> > It would not effect the editing of Python files.
> >> >
> >> >> >> {the normal ending line with ts=8 has been commented-out;
> >> >> >> otherwise the plugin file is unaltered from the Debian original}.
> >> >> >>
> >> >> >> However when I open a python file, it's obvious that 8-space tabs
> >> >> >> are being used. Doing a set: shows that
> >> >> >> softtabstop=4
> >> >> >> But there is no
> >> >> >> tabstop=4
> >> >> >> whereas opening a 'C' file will achieve the latter (and 'proper'
> >> >> >> spacing.
> >> >> >>
> >> >> >> The file is recognized as python - the keywords are highlighted
> >> >> >> as expected. Manually entering the set ts=4 sets things right.
> >> >> >>
> >> >> >>
> >> > Are there any modelines in this file?
> >> > Does this issue occur with all Python files or just this one?
> >> > Can you post an example?
> >>
> >>
> >> All python files with tabs; for example:
> >> --------------------------------
> >> #!/usr/bin/python
> >>
> >> def f() :
> >> return 1
> >>
> >> print f()
> >> -------------------------------
> >> And yes, I know that some people consider tabs sinful. Thanks so much
> >> for considering this!
> >>
> >>
> >> >> >> I've tried creating a ~/.vim/vimrc to no avail. I've not had any
> >> >> >> problem with previous incarnations of Debian.
> >> >> >>
> >> >> >> One has to suspect that some config file is overriding mine.
> >> >> >> A quick examination of the installed vim packages using
> >> >> >> dpkg -L ...
> >> >> >> has turned up nothing other than links to /etc/vim/vimrc
> >> >> >>
> >> >> >> Anyone have any hints regarding the source of this annoyance?
> >> >> >> TIA!
> >> >> >> -F
> >> >> >>
> >> >> >>
> >> >> > I use
> >> >> >
> >> >> > ~/.vimrc
> >> >> >
> >> >> > and haven't experienced any of these issues.
> >> >> >
> >> >> > --
> >> >> > Jeremiah Mahler jmmahler@gmail.com http://github.com/jmahler
> >> >>
> >> >> Thanks .. but tried that too, no change.
> >> >>
> >> >>
> >> > --
> >> > Jeremiah Mahler jmmahler@gmail.com http://github.com/jmahler
> >>
> >>
> >>
> > If I remove my ~/.vimrc and open a Python file I get ts=8 and sw=8. And
> > when I edit the file the tabs are 8 as expected.
> > I have not changed any of the system wide Vim configs in Debian.
> >
> > If I create a ~/.vimrc with only one line
> >
> > set ts=4
> >
> > and then open the Python file again I will get ts=4, sw=8 and tabs will
> > be 4 as expected.
> >
> > In your case the ts=4 setting is non-existent even if set in a ~/.vimrc.
> > This seem particularly odd.
> >
> > What Vim versions are you running?
> >
> > jeri@hudson:~$ dpkg -l vim* | grep ii ii vim 2:7.4.161-1
> > amd64 Vi IMproved - enhanced vi editor ii vim-common
> > 2:7.4.161-1 amd64 Vi IMproved - Common files ii vim-doc
> > 2:7.4.161-1 all Vi IMproved - HTML documentation ii vim-gtk
> > 2:7.4.161-1 amd64 Vi IMproved - enhanced vi editor - with
> > GTK2 GUI ii vim-gui-common 2:7.4.161-1 all Vi IMproved -
> > Common GUI files ii vim-runtime 2:7.4.161-1 all Vi
> > IMproved - Runtime files jeri@hudson:~$
> >
> > --
> > Jeremiah Mahler jmmahler@gmail.com http://github.com/jmahler
>
> I should have added one more interesting detail. If I comment out the
> (python) plugin call in /etc/vim/vimrc:
> if has("autocmd")
> filetype plugin indent on
> endif
>
This is the difference. On my machine it is commented out.
With ts=4 in my ~/.vimrc it will correctly be set with this commented out.
With it uncommented I get ts=8.
Why it behaves this way, I haven't figured out yet.
> then the tabstops work without the manual override. Having, of course,
> lost all the nice stuff associated with the plugin. Just to make sure
> I hadn't messed up the plugin I commented-out the 'set ts=4' that I
> had appended to the plugin - no change in its behavior :(
>
>
>
--
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler
Reply to: