Skip to content

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