Skip to content
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

.vimrc sourced after saving: perhaps include sourcing when user extensions are saved #252

Open
EdmundsEcho opened this issue Jun 13, 2017 · 3 comments

Comments

@EdmundsEcho
Copy link

The .vimrc file maintained by the hvn script triggers sourcing of the rc file when saved. Is it possible to have the event trigger include changes to vimrc.local and plugins.vim?

@begriffs
Copy link
Owner

begriffs commented Jul 2, 2017

Sorry, can you explain the problem in more detail?

@begriffs
Copy link
Owner

begriffs commented Sep 1, 2017

@EdmundsEcho I see what you mean, the augroup here - https://github.com/begriffs/haskell-vim-now/blob/master/.vimrc#L281-L288

It's definitely possible to source the other files as well. Probably just add the filename after $MYVIMRC. Want to try it locally and send a pull request?

@EdmundsEcho
Copy link
Author

EdmundsEcho commented Sep 5, 2017

Motivated by your feedback I found a way for it to work. If what I propose makes sense (i.e., it's not considered a hack), then the place to make the changes would be to update the documentation for how to create and use vimrc.local.

In my vimrc.local I now include the following:

" Source the vimrc file after saving it
augroup sourcing
  autocmd!
  autocmd bufwritepost vimrc.local source $MYVIMRC
  autocmd bufwritepost vimrc.local source ${HOME}/.config/haskell-vim-now/vimrc.local
augroup END

For some reason, I can't seem to trigger the sourcing of vimrc.local with just the first line. However, when I include these two lines in my vimrc.local, I do not need to change the .vimrc (or the equivalent for nvim) to get both files to be sourced when either file has been changed. A final note, by your design, we should not be changing the .vimrc file so in theory, the only functionality that matters is sourcing when we update vimrc.local. Thus far, the only solution I have is the one proposed. The documentation would include a version for the nvim and vim users (if/then seems conceptually wrong given the user knows which branch it is ahead of time).

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

No branches or pull requests

2 participants