Is there any way to override scripts that load after .vimrc?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there any way to override scripts that load after .vimrc?

jshock
My .vimrc file sets my textwidth=0, but it is being overridden by a plugin (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets textwidht=72. I only have a user account on the server, so I don't have much control over the Vim or the plugins. Is there anything I can do in my .vimrc that essentially says "ignore any textwidths that load after this"?
Reply | Threaded
Open this post in threaded view
|

Re: Is there any way to override scripts that load after .vimrc?

Benjamin Fritz
On Friday, June 12, 2015 at 10:16:48 AM UTC-5, Joe Shockey wrote:
> My .vimrc file sets my textwidth=0, but it is being overridden by a plugin
> (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets
> textwidht=72. I only have a user account on the server, so I don't have much
> control over the Vim or the plugins. Is there anything I can do in my .vimrc
> that essentially says "ignore any textwidths that load after this"?
>

:help ftplugin-overrule

All you need access to is your home directory, specifically your .vimrc file and/or a .vim folder with some files and folders inside.

Another option is using a "FileType" autocmd.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any way to override scripts that load after .vimrc?

Gary Johnson-4
In reply to this post by jshock
On 2015-06-11, jshock wrote:
> My .vimrc file sets my textwidth=0, but it is being overridden by a plugin
> (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets
> textwidht=72. I only have a user account on the server, so I don't have much
> control over the Vim or the plugins. Is there anything I can do in my .vimrc
> that essentially says "ignore any textwidths that load after this"?

You can't ignore those settings, but you can restore yours after
those settings are made.  Put this in your ~/.vimrc, _after_ any
filetype command, such as "filetype plugin on".

    au FileType * setlocal textwidth=0

Regards,
Gary

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any way to override scripts that load after .vimrc?

porphyry5
In reply to this post by jshock
On Friday, June 12, 2015 at 8:16:48 AM UTC-7, Joe Shockey wrote:
> My .vimrc file sets my textwidth=0, but it is being overridden by a plugin
> (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets
> textwidht=72. I only have a user account on the server, so I don't have much
> control over the Vim or the plugins. Is there anything I can do in my .vimrc
> that essentially says "ignore any textwidths that load after this"?
>
    set tw=2147483647

originally suggested by Tim Chase, if I recall correctly, when I asked this same thing a while back.  It works perfectly, because the plugin concerned checks for and only changes tw=0

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any way to override scripts that load after .vimrc?

Charles E Campbell Jr
In reply to this post by jshock
jshock wrote:
> My .vimrc file sets my textwidth=0, but it is being overridden by a plugin
> (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets
> textwidht=72. I only have a user account on the server, so I don't have much
> control over the Vim or the plugins. Is there anything I can do in my .vimrc
> that essentially says "ignore any textwidths that load after this"?
>
Put
    setl tw=0

in  $HOME/.vim/after/ftplugin/vim.vim

The "after" directories are loaded after everything else, so will be the
final override.

Regards,
Chip Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.