Skip to content

(RFC) add feature to overwrite default vim addons #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

igrep
Copy link
Contributor

@igrep igrep commented Jan 22, 2016

Problem

Suppose you have a .vim/ftplugin/some_language.vim is like this:

...

let g:some_variable = "foo"

...

And you want to overwrite g:some_variable with a local .vimrc:

autocmd FileType some_language let g:some_variable = "bar"

But this doesn't work because the current local-vimrc source-es .vimrcs **only on VimEnter.
While files in .vim/ftplugin/ are source-ed on every BufNewFile,BufReadPost.
So it seems that we should have some way to source local .vimrc-s after ftplugin-s!

Solution

I added another configuration called overwriter_names, with which we can choose files source-ed every time.
I agree that it's also okay to make this plugin to SourceLocalVimrc on BufNewFile,BufReadPost instead.
But I'm concerned with performance and compatibility.
So please tell me your idea.

Problem
=

Suppose you have a `.vim/ftplugin/some_language.vim` is like this:

```viml
...

let g:some_variable = "foo"

...
```

And you want to overwrite `g:some_variable` with a local `.vimrc`:

```viml
autocmd FileType some_language let g:some_variable = "bar"
```

But this doesn't work because the current local-vimrc `source`-es `.vimrc`s **only on `VimEnter`.
While files in `.vim/ftplugin/` are `source`-ed on **every `BufNewFile,BufReadPost`**.
So it seems that we should have some way to source local `.vimrc`-s after `ftplugin`-s!

Solution
=

I added another configuration called `overwriter_names`, with which we can choose files `source`-ed every time.
I agree that it's also okay to make this plugin to `SourceLocalVimrc` on `BufNewFile,BufReadPost` instead.
But I'm concerned with performance and compatibility.
So please tell me your idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant