Re: [OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-13 Thread Tobias Klausmann
Hi! 

On Mon, 09 Sep 2019, Tobiah wrote:
> We upgraded a server to 18.04 and now when I start typing
> a python file (seems to be triggered by the .py extension)
> the tabs default to 4 spaces.  We have decades of code that
> use tab characters, and it has not been our intention to
> change that.
> 
> I found a /usr/share/vim/vim80/indent/python.vim and tried
> moving it out of the way, but the behavior was still there.
> 
> I know I can put a modeline in every file but I was hoping
> to do it for every user and for every file.

This might be a generic change (i.e. not Python-specific). The
option that makes vim convert tabs to spaces is "expandtab":

'expandtab' 'et'boolean (default off)
local to buffer
In Insert mode: Use the appropriate number of spaces to insert a
.  Spaces are used in indents with the '>' and '<' commands and
when 'autoindent' is on.  To insert a real tab when 'expandtab' is
on, use CTRL-V.  See also :retab and ins-expandtab.
This option is reset when the 'paste' option is set and restored when
the 'paste' option is reset.
NOTE: This option is reset when 'compatible' is set.

I'd search their top-level vimrc for this. If you don't want to
bother or worry that your changes will be overwritten, you can
put "set noexpandtab" in your .vimrc (user-level).

Hope this helps,
Tobias

-- 
Sent from aboard the Culture ship
GCU Just Another Victim Of The Ambient Morality

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20190910080946.GA28211%40skade.schwarzvogel.de.


Re: [OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-12 Thread Ken Takata
Hi,

2019/9/10 Tue 16:01:30 UTC+9 Tobiah wrote:
>
> We upgraded a server to 18.04 and now when I start typing 
> a python file (seems to be triggered by the .py extension) 
> the tabs default to 4 spaces.  We have decades of code that 
> use tab characters, and it has not been our intention to 
> change that. 
>
> I found a /usr/share/vim/vim80/indent/python.vim and tried 
> moving it out of the way, but the behavior was still there. 
>
> I know I can put a modeline in every file but I was hoping 
> to do it for every user and for every file. 
>
>
> Thanks! 
>

Recent version of ftplugin/python.vim has the following lines:
https://github.com/vim/vim/blob/8fe1000e9c3438d0ff36cf2340f0f0e48f8fb89f/runtime/ftplugin/python.vim#L116-L119

So, if you don't want do use the recommended indent style,
write the following setting in your .vimrc:

  let g:python_recommended_style = 0

Older versions of ftplugin/python.vim may not have the setting.
Then you may need to overwrite the recommended setting by autocommand or 
some other way.

Regards,
Ken Takata
 

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/7d598eb1-735c-42e9-b75e-88890c22d819%40googlegroups.com.


Re: [OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-12 Thread Tom M


On Tuesday, September 10, 2019 at 9:01:30 AM UTC+2, Tobiah wrote:
>
> We upgraded a server to 18.04 and now when I start typing 
> a python file (seems to be triggered by the .py extension) 
> the tabs default to 4 spaces.  We have decades of code that 
> use tab characters, and it has not been our intention to 
> change that. 
>
> I found a /usr/share/vim/vim80/indent/python.vim and tried 
> moving it out of the way, but the behavior was still there. 
>
> I know I can put a modeline in every file but I was hoping 
> to do it for every user and for every file. 
>
>
> Thanks! 
>
 
To see what's going on when pressing Tab (and possibly propose a solution 
for your issue), it would be good to know the values of some settings. Open 
a python file, run the following and post the result:
:verbose set sts? ts? et? rtp?

Tom M



-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/6c5f533d-e81c-4961-9df9-81766a45e359%40googlegroups.com.


Re: [OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-10 Thread Markus Osterhoff
* Marvin Renich  [190910 14:56]:
> My opinion is that the defaults.vim file should only set options that
> almost all vim users will want, and should stay completely away from
> options that are "personal taste" (i.e. leave them with the vim internal
> default settings).  The most noticeable option that bothers me is the
> scrolloff setting.  Some people like it, and some, like me, are bothered
> by having it non-zero.  The vim default has been 0 (the vi compatible
> behavior) since the beginning of time^Wvim.  A non-zero value was added
> to defaults.vim, I suppose when vim started conditionally sourcing that
> file.  To repeat myself, defaults.vim should not set any options where
> there is a wide variety of personal preference.
Thanks for taking the words out of my mouth.

After a fresh install of a raspbian, I was *highly* confused by these
"defaults" and tempted to use emacs. No, joke! But still...

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20190910130503.GA17601%40mo-online.de.


Re: [OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-10 Thread Marvin Renich
* Tobiah  [190910 03:01]:
> We upgraded a server to 18.04 and now when I start typing
> a python file (seems to be triggered by the .py extension)
> the tabs default to 4 spaces.  We have decades of code that
> use tab characters, and it has not been our intention to
> change that.
> 
> I found a /usr/share/vim/vim80/indent/python.vim and tried
> moving it out of the way, but the behavior was still there.
> 
> I know I can put a modeline in every file but I was hoping
> to do it for every user and for every file.

I don't know if this is your problem, but a somewhat (but not too)
recent change to Vim added a file /usr/share/vim/vim##/defaults.vim that
gets sourced automatically by vim if no user vimrc file is found.  This
file sets some very subjective non-default values, and I find some of
its choices highly obnoxious.

If this is your problem, there are two possible fixes.  The first
(assuming the Debian packaging; I'm not sure if Ubuntu uses the Debian
package unchanged or not) is to edit /etc/vim/vimrc and uncomment the
line:

" let g:skip_defaults_vim = 1

The second is to ensure that the user has a vimrc file:

mkdir ~/.vim
touch ~/.vim/vimrc

My opinion is that the defaults.vim file should only set options that
almost all vim users will want, and should stay completely away from
options that are "personal taste" (i.e. leave them with the vim internal
default settings).  The most noticeable option that bothers me is the
scrolloff setting.  Some people like it, and some, like me, are bothered
by having it non-zero.  The vim default has been 0 (the vi compatible
behavior) since the beginning of time^Wvim.  A non-zero value was added
to defaults.vim, I suppose when vim started conditionally sourcing that
file.  To repeat myself, defaults.vim should not set any options where
there is a wide variety of personal preference.

Quite honestly, I don't understand why this feechur was added at all; it
means that vim has one set of defaults if the user has a vimrc file and
a completely different set of "defaults" (really?) if the user doesn't
have his own vimrc file.  This complicates vim startup, and adds one
more thing a new vim user needs to learn immediately when starting to
personalize vim by creating a ~/.vim/vimrc file:  Install vim and start
using it; decide to create a vimrc just to change one or two options (or
maybe not to change any option but to add a key mapping); now vim
behaves quite differently, and the new user has to figure out why and
how to get all the "original" behavior back.

...Marvin

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20190910125625.6qeqe5wfswcdanuc%40basil.wdw.