Saturday, March 21, 2015

Re: What sets textwidth=78

On 2015-03-21 10:20, Graham Lawrence wrote:
> Thanks for your response, it was hard to track down even with
> the :verbose ... command, because the condition occurs erratically,
> but it did happen this morning and the command revealed it was
> caused by /usr/share/vim/vim74/ftplugin/vim.vim, which I think can
> reasonably be regarded as a function of vim itself.
>
> I just use the standard package issued by arch, any additional
> functionality I want I write myself, and the last thing I would
> ever do is limit the line length.

My understanding based on what you give (modulo any Arch-specific
changes that aren't present on my Debian Stable box with 7.3 stock,
though I'd expect that Arch sticks much more to the native package
compared to the modifications that Debian likes to make to packages)
that

1) this should only happen when editing *.vim files or you manually

:set ft=vim

2) this setting should only persist in vim files since it
uses :setlocal rather than :set (which would persist across
newly-opened windows)

3) it checks if a 'tw' is already set and doesn't mess with it if
it's non-zero. Thus, you might be able to hack it with something
like

:set tw=2147483647 " the maximum line length for non-DOS vim

so that it's effectively unlimited, but it prevents that ":setlocal
textwidth=78" from triggering.

When undone, it should un-set the local version, reverting back to
the global option.

-tim




--
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: